Lost in the corn hubbub has been the rise of wheat, barley, and other grains. Grains as a whole (pun intended) have risen 54% in the last year, an increase that is devastating for food manufacturers and consumers alike, who both end up sharing the burden. However, some manufacturers may be better suited than others to handle this environment and could come out ahead of their competition.

What they're facing

US Corn Price Chart

US Corn Price Chart by YCharts

Since 2007, the average price of corn and wheat has been almost double what it was for the previous part of the decade. This doesn't just affect people buying ears of corn or bags of flour at the supermarket. Beer companies such as Molson Coors (NYSE: TAP) and Boston Beer (NYSE: SAM) use wheat in some of their products, but also massive amounts of barley, the price of which has gone up even more than wheat. Sara Lee (NYSE: SLE) and General Mills (NYSE: GIS) are similarly dependent on both wheat and corn for their baked goods and cereals. Even Coca-Cola (NYSE: KO) and PepsiCo (NYSE: PEP) are largely dependent on corn for corn syrup in their sodas.

Molson Coors Brewing Company Gross Profit Margin Stock Chart

Molson Coors Brewing Company Gross Profit Margin Stock Chart by YCharts

These dependencies have led to a general decline in gross margins over the past five years for everyone except General Mills and Molson Coors -- impressive given that wheat, rice, and barley have nearly doubled in price during that time. It is also worth pointing out that margins at Boston Beer are down only very slightly, and the trend over the last few years has been one of consistent improvement.

However, gross margins just tell us how well each company's pricing power has stood up to increasing costs, which is only part of the story. Operating margins tell us more about a company's ability to respond to cost pressures using all of its tools, whether by raising prices to offset raw-material cost increases, creating more efficient operations to lower production costs, or even using corporate layoffs to reduce SGA expenses.

Molson Coors Brewing Company Operating Margin (TTM) Stock Chart

Molson Coors Brewing Company Operating Margin (TTM) Stock Chart by YCharts

Here we see again that Molson Coors and General Mills have increased margins, but Molson Coors has improved so much you have to wonder if they keep their offices as cold as the Rockies to save on the heating bill. Boston Beer has also shown remarkable improvement, along with surprise contender Sara Lee, which had the worst gross margin declines at one point.

The only companies that haven't improved have been the soda makers. This is odd, because, given the popularity of Coke and Pepsi, one would expect them to have the pricing power to pass costs on to customers. After all, people don't drink Coke because it's cheap. As Warren Buffett pointed out, Coke is sold wherever people are happy, and the company has a moat that RC Cola couldn't breach with any amount of money.

This helps to explain how even in its beverage segment, Pepsi's operating margins are consistently lower than Coke's. So even though both nearly doubled sales over the last five years, Coke turned more of that into net income.

Molson Coors Brewing Company Net Income (TTM) Stock Chart

Molson Coors Brewing Company Net Income (TTM) Stock Chart by YCharts

Coke's net income gains topped even those of Molson Coors, despite having the worst margin compression compared to the best margin expansion. This is due largely to Coke's comparative revenue growth, but more impressive here are the gains at Boston Beer, which have taken off largely unabated since early 2009, when one would expect most people to have forsaken quality and started drinking copious amounts of cheap beer. Nor has this come from cheap accounting gimmicks -- Boston Beer has posted the highest free cash flow gains by far.

Molson Coors Brewing Company EV / Free Cash Flow Stock Chart

Molson Coors Brewing Company EV / Free Cash Flow Stock Chart by YCharts

The Foolish bottom line
Though high grain prices mean explosive growth for some companies, others have to muddle through a difficult operating environment. Despite its low-price reputation, Molson Coors has been able to pass some costs on to customers, to the great benefit of its margins. By virtue of its huge moat, Coke already had high margins, and despite shrinking the most they remain the second highest, and its heavy revenue growth has contributed greatly to profitability. But the real secret winner here is Boston Beer, which has grown margins only slightly, while dramatically increasing free cash flow, yet it seems to have gone largely unnoticed by the market. Add these three top performers to your free My Watchlist to see how things develop.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.