NEW YORK (TheStreet) -- In December, when shares of Pinnacle Foods (PF) traded at around $26, investors were advised to nibble on the stock. Since that recommendation, the shares have soared close to 40% to Friday's close of $30.45. Shares are up 32% year to date.

Although the entire packaged-food industry was struggling with weak volume and compressing margins, I was impressed with Pinacle's focus on expenses to achieve the sort of margins necessary to increase earnings. Not to mention, Pinnacle had just picked off salad dressing brand Wish-Bone from Unilever (UN) for $580 million, a deal that I projected would increase Pinnacle's fair value to $35.

On Monday, Hillshire Brands (HSH) agreed as it announced a $4.23 billion cash-and-stock deal for Pinnacle, whose brands include Duncan Hines, Bird's Eye, Hungry Man and Aunt Jemima. The deal represents a 18% premium to Pinnacle's Friday closing price.

WATCH: More market update videos on TheStreet TV

Each share of Pinnacle's common stock will be exchanged for $18 in cash and a half share of Hillshire's common stock. The exchange places a valuation on Pinnacle stock at $36.02 per share, roughly 3% above my projected fair value in my December article. Including debt, the deal is worth $6.6 billion.

While it's not an expensive deal for Hillshire, it's a respectable premium for Pinnacle, which has operated as a public company for only about one year. Since its March 2013 IPO, the shares are up more than 26%.

Following the IPO, there were concerns about Pinnacle's long-term debt and interest expenses. But interest expenses fell 30% in the fourth quarter from a year earlier. The company has paid down well over $1 billion of debt during the past year. Proceeds of $667 million from the IPO went to pay off debt.

For Hillshire, which owns popular brands such as Jimmy Dean sausage and Ball Park franks, the company is getting an expanded portfolio in frozen foods. The combined company, which will keep the Hillshire name, is expected to have roughly $6.6 billion in annual sales. Hillshire President and CEO Sean Connolly will serve as its president and CEO.

With Pinnacle's expected double-digit earnings growth this year and in 2015, this is great deal for both companies. The combined entity is expected to save $140 million annually by 2017. 

As of this writing, shares of the companies took opposite turns. Pinnacle traded up more than 17% to $35.75, while Hillshire's stock gave up almost 2% to $36.30.

>>Read More: Apple's Next Major Acquisition After Beats

>>Read More: Puma Wins Big at NFL Draft With Jadeveon Clowney

At the time of publication, the author held no position in any of the stocks mentioned.

This article represents the opinion of a contributor and not necessarily that of TheStreet or its editorial staff.