With the new year quickly approaching, there's no better time to review where the market has taken us so far this year. From falling home prices, higher oil prices, and a tight presidential election to the edge of the fiscal cliff, 2012 has been anything but dull. Today, let's peek into the supermarket sector to see which stocks returned the most and least to shareholders in 2012.

The bad ...
I'll lead with the laggards so that we might end on a high note. SUPERVALU (SVU) proved to be an oxymoron of sorts, considering the company was unable to generate super value for its shareholders. In fact, the stock has lost more than 69% of its value year to date. The struggling grocery-store chain faces increased competition from discount retailers, such as Target (TGT -1.68%) and Wal-Mart (WMT -1.48%).

Similar to Wal-Mart, Target now offers fresh produce and grocery items in most of its stores. According to Morningstar, "The traditional grocery channel has lost nearly 20% market share to supercenters and wholesale clubs during the last quarter-century." If this trend continues, it won't be long before companies such as SUPERVALU become irrelevant.

Wal-Mart and Target stores, on the other hand, continue to outperform competitors. Both stocks are up more than 19% year to date. But SUPERVALU isn't the only traditional food retailer to have slipped this year. Safeway (NYSE: SWY) has lost 24% of its value year to date, which isn't surprising given the company's stubborn pricing strategy.

Unlike SUPERVALU, Wal-Mart, or Target, which offer their products at discounted rates, Safeway overcharges consumers for the same products. This is a problem, considering Safeway doesn't attract the higher-end customers that, say, Whole Foods Market (WFM) does. Moreover, Safeway's operating margins will probably continue to suffer as customers flock to competitors that offer more value.

With this year's losers out of the way, let's jump into the winner's circle.

... and the better
Whole Foods tops our list with the best year-to-date gain of the group: The stock is up more than 35% year to date. This shouldn't be too surprising, given the considerable growth that's still left in the name. Not to mention that income investors are surely happy about the upcoming Dec. 21 special cash dividend of $2 per share. This, of course, will be in addition to the company's standard quarterly dividend.

Whether management decided to pay this special dividend because of possible tax increases in 2013 is of little importance. The key here is that Whole Foods is one of the best-run companies in this industry. With more than $1.2 billion in cash and cash equivalents on its balance sheet, Whole Foods should be able to maintain its lead over its rivals in the year to come.

Costco (COST -0.47%) is another company to join Whole Foods in the winner's circle this year. Similar to Whole Foods, Costco also will be issuing a one-time dividend. The wholesaler plans to pay a special cash dividend of $7 per share, payable on Dec. 18. This shouldn't be a problem for Costco, considering the company's balance sheet boasts a cash hoard of more than $5.6 billion in cash and cash equivalents. The stock is up more than 13% year to date.

I suspect that Costco will continue winning in the year ahead thanks to its competitive moat. Annual membership fees, which the company charges up front, represent a network effect that keeps customers returning to its stores. In fact, research from Morningstar shows that Costco's member renewal rates have remained around 86%, despite fee increases and economic downturns. These are all positive signs heading into 2013.

In third place, with a 10% return year to date, is grocery-store chain operator Kroger (KR -0.34%). By offering customers discounted fuel at more than 1,000 of its supermarket locations, Kroger has been able to attract more customers to its stores on a regular basis. This strategy has also contributed to Kroger's lead over other traditional grocery chains, including Safeway.

Kroger also manufactures and sells private-label brands, which have helped the company keep gross margin rates from suffering. Looking ahead, Kroger may be the only traditional grocer able to fend off competition from supercenters such as Wal-Mart.

Looking ahead
If 2012 has taught us anything about this sector, it's that traditional grocery retailers face an increasingly challenging landscape. As we embrace the year ahead, I believe Safeway is the stock to sell, Whole Foods is one worth holding on to, and Costco is still a buy.