Shares of CBS rose 1.6% to $49.70 in premarket trading, while Viacom fell 2% to $29.40.
Viacom shareholders will receive just above 0.595 CBS shares for each share they own, the sources said, adding that the final terms could still change.
The two companies are controlled by National Amusements, the holding company owned by billionaire Sumner Redstone and his daughter Shari.
The deal comes at a time when an increasingly competitive media landscape prompted the Redstones to reunify the two companies 13 years after breaking them up.
This is CBS's third attempt since 2016 to bring the U.S. entertainment companies together. Previous merger talks had failed because of clashes between executives over divvying up top jobs and the companies' relative valuation.