With gasoline prices moderating a bit from recent highs reached this past spring, it might be time for investors to cruise the grocery aisles on the theory that more consumer cash will flow to supermarkets.

Looking at three major stocks in the grocery category -- Whole Foods Market (Nasdaq: WFM), Kroger (NYSE: KR) and Safeway (NYSE: SWY) -- you'll see a remarkable diversion in share price trends this year. The variance suggests that the substitution effect between gasoline and groceries doesn't tell the whole story.

Whole Foods Market Price Stock Chart by YCharts

Wall Street has rewarded Whole Foods, with 2010 revenues of $9.0 billion, for at least two reasons: steady annual gains in annual revenues and its more upscale customer base that is less sensitive to price increases. The growth rate of Whole Foods' trailing 12-month revenues has held up well against gasoline prices. Revenues at Kroger and Safeway have followed a more predictable pattern.

Whole Foods Market Revenues (TTM) Stock Chart by YCharts

Wall Street also likes Whole Foods' superior profit margins. And as a result, Whole Foods' market cap is brawny.

Kroger, with 2010 revenues of $82.2 billion, likewise boasts a steady record of annual revenue growth. But its broader range of customers is more sensitive to oil prices as well as to grocery price inflation and employment worries.

Safeway, with 2010 revenues of $41.0 billion, draws from a similarly broad customer base as Kroger. But Safeway's revenue growth stumbled in 2009, when the company cut prices in search of a greater market share. Wall Street remains skeptical about the company's growth potential, especially if food inflation accelerates in the months ahead, as many economists expect.

For value investors who follow the Goldilocks rule -- not too hot, not too cold, Kroger may be just right. Shares, rated a strong "neutral" by YCharts, are trading slightly under their historical valuation, as tracked by YCharts. Whole Foods shares, with a neutral rating, are considerably overvalued by the same measure and by the ratio of price per share to sales per share.

Safeway Price / Sales Ratio Stock Chart by YCharts

On the other hand, Safeway is the only one of the three companies rated "attractive" by YCharts. Its shares were hit by its latest quarterly report and conference call, which failed to convince analysts that the company is on track to recover any time soon from its 2009 stumble. For ambitious value investors, Safeway is more undervalued than Kroger and pays a dividend yield of nearly 3 percent.

Bill Barnhart is an editor for the YCharts Pro Investor Service which includes professional stock charts, stock ratings and portfolio strategies.