Viacom originally began as CBS Films, Inc., the television syndication division of CBS. In 1971, the division was renamed Viacom, and in 1973 it was branched off because of new FCC rules that prohibited television networks from owning syndication companies.
During the 1970s and 1980s, Viacom was highly profitable. Its main operation was distributing old CBS classics to syndication, including I Love Lucy, The Andy Griffith Show and All in the Family. They also syndicated shows for other networks, the most popular examples being The Cosby Show and Roseanne.
In September of 1999, CBS and Viacom announced a $35.6 billion-dollar merger, the largest in U.S. History. The merger put the CBS/Viacom union in second behind Time Warner as the nation’s largest media companies.
In March of 2005, Viacom announced plans of looking into splitting the company into two separate companies. The split was approved by Viacom's board in June of 2005, and took effect December 31, 2005. This split effectively reversed the CBS/Viacom merger of 1999.
The CBS side changed its name to The CBS Corporation and the other side spun-off into operation under Viacom, which comprises MTV Networks, BET Networks, Paramount's movie studio, and Paramount Pictures' home entertainment operations.

Sources:
http://money.cnn.com/1999/09/07/deals/cbs/
http://www.cbsnews.com/stories/2005/06/14/national/main701875.shtml
http://www.fundinguniverse.com/company-histories/Viacom-Inc-Company-History.htm