Coca-Cola (NYSE:KO), one of the most ubiquitous brands in the world and one of Warren Buffett’s favorite stocks, is a powerhouse in the business world. But there are some forces even more powerful than Coke.

Namely, a force of nature. Drought has caused rising corn prices and taken a bite out of Coke’s bottom line.

Rising costs held back the soft-drink maker in its second quarter — though higher sales volume meant impressive revenue numbers — in a sign that bigger costs are taking a bigger chunk out profits for major corporations.

Here are the details: Coca-Cola posted second-quarter earnings on Tuesday that tallied $2.79 billion in profits, or $1.21 a share. That was down from $2.8 billion ($1.20 a share) a year earlier.

You might not think that’s a big deal, but the company had posted year-over-year profit increases for 11 out of the past 12 quarters before this report. So Coca-Cola doesn’t miss the mark often.

Some fear a long-term drop in soft-drink consumption as Americans get healthier, but that wasn’t the problem. Even as the U.S. reduces its demand, Coke is booming abroad in more than 200 countries worldwide. In fact, revenue rose 2.7% on the quarter to over $13 billion.

No, the trouble was rising costs for such raw materials as the plastic used to make bottles and the corn used in sweeteners. According to the company’s quarterly report, Coca-Cola’s gross margin edged down to 60.1% from 60.8% while input costs jumped 4.7%.

Corn is particularly troublesome amid a drought that is decimating U.S. crops in the Midwest. Nearly everything is getting more expensive as a result of corn — from beef from corn-fed cattle to whiskey made from corn mash to margarine using corn oil. And of course, that old culprit high-fructose corn syrup is driving up costs for juice and soft-drink makers like Coke, PepsiCo (NYSE:PEP), Dr. Pepper-Snapple (NYSE:DPS) and others.

So what does this mean for investors? Well, long-term investors will continue to find solace in Coca-Cola since the drought will pass. Coke stock is going to split 2-for-1 in the next several weeks, and that provides a big buying opportunity. The stock yields a nice 2.7% dividend, and its defensive nature in the consumer staples sector remains attractive. And, of course, Warren Buffett’s Berkshire Hathaway (NYSE:BRK.A, BRK.B) continues to think Coke is a sweet play. The investment company owns almost 9% of all outstanding Coca-Cola stock for an amazing $15.5 billion position in the stock.

In the short term, however, Coke might see some headwinds. Growing international sales continue to be a bright spot, but the weight of inflationary pressures is real. More importantly, investors should take note of the impact in the second quarter and the fact that corn prices have moved even higher in recent weeks.

That means the story might be the same for Coca-Cola in Q3 as well — and that similar businesses in the soft-drink game will see rising input costs weigh on their profits.