Surprise, surprise -- many of the retailers peddling low-priced goods pulled off yet another month of excellent same-store sales performance in May.

That said, the market may have gotten a bit too exuberant over the news today. After all, consumers are beginning to receive their tax rebate checks, and it stands to reason that those who planned to spend those windfalls instead of save them ventured out to load up on goods in May. And if those temporarily wealthy shoppers did flock to discount stores, the majority of rebate spending probably went toward household necessities -- not necessarily a promising economic sign.

The price is right
Continuing a months-long trend, Wal-Mart (NYSE:WMT) is one of the standouts, suggesting that the struggling megaretailer is back in its element. Costco (NASDAQ:COST) is another of the big winners.

Wal-Mart's May same-store sales surged 3.9%, even excluding the benefit of fuel sales. Analysts had only expected a 1.6% increase in May comps. Not surprisingly, though, Wal-Mart credited the stimulus checks as a boost to its May sales data. The discounter predicted a same-store sales increase of 2% to 4% in June, counting potential benefit from the government rebates as well. Given Wal-Mart's habit of issuing conservative guidance, that's really saying something.

Costco's May same-store sales were mind-blowing, too. The whopping 9% total increase does include pricey gasoline sales, but even without the gas, Costco's 5% increase certainly isn't too shabby.

Discounters' strong performance isn't entirely surprising, given the daily parade of grim economic tidings. It's also no shocker that Target's (NYSE:TGT) May comps dipped 0.7% -- that discounter hasn't been "on fire" lately like Wal-Mart and Costco have.

Consumer spending can't float all boats
Retail stocks rallied today on the good news. I think many investors have been scared away from good retail bargains, but I also think that interested Fools should choose their investments here carefully. For one thing, the May comps data wasn't all good; for every Wal-Mart or Costco understandably trouncing expectations, there were plenty of other stores with less rosy results.

Look at Gap (NYSE:GPS). Investors waiting for this company's seemingly interminable sales turnaround will have to stay patient. Gap's May comps fell a nauseating 14%, with Old Navy continuing to be a weak spot. (Analysts expected Gap's May comps to "only" drop 9.5%, so it's hard to find heartening news there.) If bargain-hunting consumers, perhaps with rebate checks in hand, nonetheless avoided bargain-priced Old Navy in May, the outlook for Gap in general seems anything but bright.

American Eagle Outfitters (NYSE:AEO) also had a dismal month, with comps decreasing 9%; analysts had only expected a 4.8% drop. Limited Brands (NYSE:LTD), which now solely consists of Victoria's Secret and Bath & Body Works, slightly missed expectations when its comps fell by 6% in May, as opposed to the 5.5% decrease Wall Street expected.

All hail the buyer's market
Many discounters' strong performance is a testament to consumers' penny-pinching, dollar-stretching behavior. But lackluster sales from Sears Holdings (NASDAQ:SHLD), Old Navy, and Target suggest that customers are increasingly choosy, and low prices alone aren't enough to lure them in.

Maybe shoppers are simply going for deals they consider truly compelling, and snubbing the rest. (I envision crowds of budget-minded consumers with hands on hips, demanding that stores make it worth their while.) Maybe many retailers simply can't strike the perfect balance between lower prices and compelling merchandise. Getting that magic formula right isn't easy during downturns.

There are still cheap retail stocks out there, and many investors are totally missing out because of their paranoia about the entire sector. However, the search for quality and the best bang for your buck -- in investing as in shopping -- is more important than ever.