Wikimedia commons

CBS (CBS - Get Report) beat Wall Street's second-quarter earnings expectations as the media giant reportedly worked on a merger agreement with Viacom (VIAB - Get Report) .

Shares of CBS were down 4.4% to $48.57, while Viacom was off 2.6% to $29.98.

The New York-based company reported earnings of  $440 million, or $1.17 a share, up from $1.05 a year ago, and beat analysts' expectations of $1.12. Sales totaled $3.81 billion, up from the year-ago figure of $3.47 billion and exceeded Wall Street's forecast of $3.71 billion.

"CBS delivered another outstanding quarter as we continue to execute on our long-term growth strategy, which is to invest in our premium content and direct-to-consumer streaming services," Joe Ianniello, president and acting CEO, said in a statement.

Advertising revenue grew 7%, CBS said, led by the company's broadcast of the national semifinals and championship game of the NCAA Division I Men's Basketball Tournament. Content licensing and distribution revenue rose 12%, mainly as a result of higher domestic licensing sales. Affiliate and subscription fee revenue rose 13%.

Separately, the New York Post reported that CBS and Viacom could announce a merger deal within a few days. The main sticking point has been how to value the companies, the Post said, citing two separate sources. This is the third time the two companies have discussed a merger in the last four years.

On Thursday, Viacom reported stronger-than-expected second-quarter earnings as profits from its Paramount studios grew for the 10th consecutive period.