Ralcorp's stock jumped $18.66, or 27 percent, to $88.89 in premarket trading. Shares of ConAgra gained $1.64, or 5.8 percent, to $29.93 in trading more than an hour before the market opening.
"We believe the two companies are a great fit, and our employees will benefit as part of a larger diversified organization with the necessary scale and resources to be a leader in today's rapidly evolving marketplace," Ralcorp CEO Kevin Hunt said in a statement.
The companies value the transaction at about $6.8 billion when debt is included. ConAgra said it plans to finance the acquisition mostly with available cash, existing credit facilities and new borrowings. It expects about $225 million in cost savings on an annual basis by the fourth full fiscal year after the deal closes.
The deal, which was unanimously approved by both companies' boards, is expected to close by March 31, 2013. It still needs Ralcorp shareholder approval.
ConAgra said that the buyout should have a modest benefit on its fiscal 2013 financial results. The Omaha, Neb.-based company still anticipates fiscal 2013 earnings in a range of $2.03 to $2.06 per share, excluding any benefit from the Ralcorp deal.
Analysts predict earnings of $2.06 per share.