CBS Corp. and Viacom, once part of the same company, plan to again join forces in a merger to bolster their positions in a rapidly changing entertainment industry that's pushing other media giants to consolidate their digital content for the streaming age. CBS Corp. is buying Viacom in an all-stock transaction that values Viacom at its current stock market capitalization of around $12 billion, the companies announced Tuesday.

The market value of CBS Corp. is about $18 billion. The combined company, ViacomCBS Inc., will have more than $28 billion in revenue and the largest market share – 22% – of the U.S. television viewing audience, according to the companies.

CBS Corp. owns the CBS Television Network, CBS News and 15 CBS-TV stations in the country's major television markets, as well as the cable network Showtime and the publisher Simon & Schuster. Viacom controls several major cable networks, including BET, Comedy Central and MTV – and the movie studio Paramount.

Get Breaking News Delivered to Your Inbox

Viacom and CBS first merged in 1999 during the dotcom bubble in a deal that was valued at $35.6 billion at the time. One news outlet described management's vision as "a blockbuster ... move which is designed to bring the network of Dan Rather in touch with the MTV generation."

The blockbuster proved a bust, however, and the companies split up just a few years later, in 2005. Since that time, CBS stock has more than doubled in value, trading at nearly $50 a share this week, while Viacom stock has stayed more or less flat, trading at nearly $30 a share Tuesday.

Meanwhile, the media industry has come to be dominated by entertainment and telecommunication industry giants forming ever-larger combinations. Walt Disney Co. in March bought most of 21st Century Fox in a deal valued at $52 billion, while AT&T in June completed its acquisition of Time Warner for $85 billion. U.S. cable conglomerate Comcast bought a majority of European pay-TV operator Sky News in October for $40 billion.

These established players are also competing against internet companies including Amazon and Netflix, each of which have at least 100 million paying subscribers and are pouring billions into creating content. And Apple this fall is expected to launch its own video-streaming platform, capping years of planning by the world's most valuable public company to enter the TV and movie business.

"Right now there's a major transition going on regarding the consumption of TV — people are moving away from the traditional bundle to direct-to-consumer, on-demand shows or combinations of both," said Neil Begley, an analyst at Moody's.

The CBS-Viacom merger will add a newly enlarged company to the mix with a combined market value of about $30 billion — big enough to still matter and grow through further media acquisitions, yet still something of a snack for, say, Apple, which is sitting on $245 billion in cash.

"The combined CBS-Viacom would have many positive attributes, from cost synergies to dramatically improved leverage with distributors for the Viacom networks," Moody's analysts wrote in a note. "It would also have greater combined scale of content production, diversity and distribution."

But that may not be big enough for the long term, Begley added. "Frankly, they may not be big enough still to compete with Disney and Netflix," he said, noting that "Netflix spends something like $15 billion on new product."

Shari Redstone will become the new board chair of the combined ViacomCBS Inc. Reuters

Both CBS Corp. and Viacom have long been controlled by Sumner Redstone, 96, and more recently his daughter, Shari, 65, through their family's privately owned company, National Amusements, which operates movie theaters in the U.S., U.K. and Latin America. Shari Redstone is the president of National Amusements and vice-chairwoman of both CBS and Viacom. She will become chair of the combined ViacomCBS board, making her arguably the most powerful woman in the media industry.

"I am really excited to see these two great companies come together so that they can realize the incredible power of their combined assets," Shari Redstone said in a statement. "My father once said 'content is king' and never has that been more true than today."

The companies have sought a merger several times in recent years, but their management teams' differences were never bridged. Then the CBS board went through a dramatic overhaul last year following the departure of longtime CEO Leslie Moonves over misconduct allegations. The changes paved the way for Tuesday's announcement.

Under the deal's terms, Viacom shareholders would receive about a 0.6 share of CBS stock in exchange for 1 share of Viacom stock. The Redstones' National Amusements would retain control of the combined ViacomCBS through its ownership of Class A voting shares that currently represent nearly 80% of the shareholder votes at both companies. The deal would close by Dec. 31, pending any regulator approvals.

Viacom CEO Bob Bakish will become the president and chief executive officer of the combined ViacomCBS, the companies said.

Joe Ianniello, the president and acting chief executive officer of CBS Corp., will become chairman and CEO of CBS, overseeing all CBS-branded assets in his new role, the companies said.