America likes coffee. According to the U.N., we imported about 1.5 billion kilograms of the stuff in 2011. Of that huge quantity, 88% came in as unroasted, green coffee, which was then processed or sold on. It should come as no surprise that fluctuations in green coffee prices have had a huge impact on American businesses. In 2009, the U.S. imported 8% less green coffee than in 2011, but paid about 50% less for it. The spike in raw costs has hit some companies hard, but things are starting to look up.

Who's buying
Coffee is usually split into two main varieties, Robusta and Arabica. Robusta is used in lower-end and general consumer coffee, while Arabica finds its way into most of the brand-name coffees that are sold in the U.S. For instance at the end of 2011, Starbucks (Nasdaq: SBUX) forecast earnings-per-share growth of only 5% in the first half of 2012 because of high coffee costs. Compare that with a second half prediction of 25% growth.

Starbucks has done a better job than some competitors, though. Green Mountain Coffee (Nasdaq: GMCR) had some ill-timed purchases in 2011, causing its inventory value to increase 156%. Both companies have had to manage the increased costs by reducing their bottom-line margin. Other companies haven't been so flexible.

Farmer Brothers is a lower-end retailer and wholesaler of coffee, selling in grocery stores under a number of brands including Cafe Royal. Farmer has suffered over the past five years, with shares falling 60% over that period. The vast majority of the problem can be traced right back to green coffee. Revenue has increased every year since 2007, but income has fallen. In 2007, the company held on to $6.8 million. Last year, it lost $54.3 million.

Light at the end of the tunnel
But things are starting to look up for coffee companies. Coffee prices are down 25% so far in 2012. Per-pound costs have come down to near $1.70 from their May 2011 peak at more than $3. That's going to mean more cash in companies' wallets and bigger earnings for shareholders. Starbucks has already exceeded its 5% prediction, growing earnings 18% in Q2 and 19% in Q3.

Investors should expect that trend to continue throughout the rest of the year. The only setback to coffee pricing could be heavy rains in Brazil, which could reduce production. But barring any major catastrophes, the cost for green coffee seems to have found a realistic price. Certainly, Joh. A. Benckiser has seen a reason to make a move, with its recent bid for Peet's Coffee (Nasdaq: PEET).

The private firm has put up a $1 billion offer for Peet's, and investors are expecting a counteroffer as well. Most speculation has centered on Starbucks, which has need of a good brand for European distribution and which has some flexibility now that coffee prices are on the decline. A side effect of a drop in materials pricing is that companies do have a bit more room to play with their cash on hand.

That means that Starbucks may not be the only company to come calling for Peet's. Rival Dunkin' Brands (Nasdaq: DNKN) could definitely use help expanding its in-store lineup and getting into new international markets. Last quarter, the company's international segment accounted for only 3% of total revenue. But Dunkin' just doesn't have the cash to make a meaningful bid, without raising additional capital. Any other bid would have to come from a larger company.

The bottom line
While this isn't secret knowledge, now is an excellent time to think about investing in coffee companies. Starbucks has some interesting things happening this year, Peet's could be the center of a bidding war, and Farmer is still trading at less than $8. It's only a matter of time until lower coffee prices start making big impacts on companies' bottom lines, and investors should do the research now to get in ahead of the pack.

One of the most interesting and contentious coffee brands continues to be Green Mountain. It's made some mistakes, and certainly there's some question about its accounting. But it's a fascinating story, and long or short, someone is going to be making a fortune off of it this year. The Fool has a new premium report on Green Mountain Coffee Roasters explaining all of the opportunities and risks associated with the company. We're updating this one throughout the year, so signing up now gives you access to ongoing research. Go check it out today.