It was a heady year for craft brewer Boston Beer (NYSE: SAM), so with the end of 2011 in sight, now might be a good time to review what happened that caused the market to drain the stock midyear only to fill up its mug again with frothy gains.

Reviewing what happened yesterday gives you a chance to decide if it's still right for your portfolio today and whether it makes sense to buy more shares for tomorrow.

Sounds good
Brewing with the intention of being the best-tasting beer has always been the key ingredient in the brewer's growth trajectory, but a growing distribution network doesn't always lend itself to the freshest-tasting beer. Below, I'll take a closer look at the events driving Boston Beer's stock this year.

Boston Beer at a glance

Year-to-Date Stock Return 12.3%
Market Cap $1.36 billion
Revenue, Trailing 12 Months $486.7 million
1-Year Revenue Growth 8.3%
1-Year Profit Growth 10.3%
1-Year Free Cash Flow Growth (15.5%)
CAPS Rating (out of 5) ****

Sources: S&P Capital IQ, Motley Fool CAPS. Free cash flow growth is unlevered as provided by Capital IQ.

What happened to Boston Beer in 2011?
Regardless of the industry, rising commodities costs impact operations everywhere. Higher costs for grains have hurt the bottom lines of cereal makers like General Mills (NYSE: GIS), which rely upon wheat and corn, while brewers are affected by the rising price of barley and hops. Molson Coors (NYSE: TAP) reported profits were driven 24% lower in part because of higher commodity costs and Anheuser-Busch InBev (NYSE: BUD) saw operating costs rise largely as a result of rising commodity and packaging costs. Aluminum also costs a lot more these days.

While the Samuel Adams brewer doesn't use cans to package its beer, it says it's expecting to raise per-barrel prices 2.5% to 3.5% next year to help offset significant increases it's expecting in barley prices.

Boston Beer also contends with its own promise to make the best-tasting brew it can. There's simply a different level of quality between mass-produced beers from Coors and Bud and those crafted by Boston Beer, Craft Brewers Alliance (Nasdaq: HOOK), and even Diageo (NYSE: DEO), whose brands include Guinness, Harp, and Red Stripe. Constellation Brands' (NYSE: STZ) lineup of Corona, Modelo, and St. Pauli Girl would probably fall somewhere in between.

Boston Beer has gone an extra step to reinforce that distinction, by implementing a freshest beer program.

Tap into great taste
There's a certain level of marketing hype behind Boston Beer's just-in-time inventory program, which seeks to ensure the beer you're getting out of your local bar's tap tastes the same as CEO Jim Koch gets when he taps a keg at the brewery. Millions of people, myself included, like the taste of a Sam Adams as it is now; making it "fresher" won't necessarily make it "better."

But there's a cost to the way things are done now, and though Boston Beer is currently seeing the program drain profits from its financial statements, it's looking to save money down the road.

Typically, distributors carry five weeks of packaged inventory and three to four weeks of draft inventory. The freshness program wants to reduce those times to two weeks. By reducing the amount of time inventory sits on distributors' shelves, the beer consumers drink will theoretically taste better.

However, the program is lowering shipment volumes and impacting earnings. Boston Beer expects to have half its volume supported by the program by the end of this year, and 70% by the end of next. When the program is fully implemented, the brewer expects volumes to return to previous levels.

The drag on earnings, the lower volumes, and the higher costs all took a toll on Boston Beer's stock, which dropped from almost $100 a share down to nearly $70 at the end of September. Yet last quarter saw depletions rise 11% as retailers restocked their shelves and core shipments rose 7%, leading the brewer to increase full-year expectations. Its stock is back above $100 a share.

Ready for another round
Despite craft brewers continuing to soak up more of the beer industry's market share and the prospects for Boston Beer looking particularly heady, The Motley Fool's analysts have found a company they think can achieve equally monstrous returns in 2012. Request your copy of the special free report, "The Motley Fool's Top Stock for 2012," but do so today because it's a limited-time offer.

Add Boston Beer to the Fool's free portfolio tracker, which can find all of our Foolish analysis on it and all your other stocks.