June was dismally slow for retailers, but today's same-store sales results indicate that shoppers returned during the month of July. On the whole, comps came in stronger than had been anticipated, leading some retailers to raise their quarterly earnings guidance.

July is traditionally a discounting month, with retailers clearing out summer merchandise to make way for fall goods. As such, it's not usually an important month for gauging retailers' health. Today's results are encouraging, though, in that they turned around June's poor showing and created hope that consumers' demand will carry over into the crucial August and September back-to-school months.

Discount powerhouse Wal-Mart (NYSE:WMT) posted a 4.6% comps gain, and raised second-quarter guidance from $0.50 to $0.52 a share. Kohl's (NYSE:KSS) and Target (NYSE:TGT) also reported better-than-expected comps, coming in at 6.7% and 3.1% respectively.

Even among the beleaguered department store group, same-store sales came in ahead of expectations. Sears' (NYSE:S) July comps fell 0.8%, a smaller decline than was anticipated. J.C. Penney (NYSE:JCP) and May (NYSE:MAY) announced comps gains of 3.7% and 1.8%, respectively, both substantially ahead of expectations. Federated (NYSE:FD) posted a 0.4% comps decline, which was not as severe as had been predicted. Because of the improved results, Federated raised earnings guidance for its second quarter to $0.60-$0.63 from its prior guidance of $0.50-$0.55.

Specialty retailers joined the July party, too. Teen surf shop Pacific Sunwear (NASDAQ:PSUN) reported its usual bright comps, with a 15.1% gain. It also raised Q2 guidance again, this time to $0.25-$0.26 from last month's $0.23 (which was itself raised from $0.20). Hot Topic (NASDAQ:HOTT) followed the same path, with a comps increase of 8.7% and new earnings guidance of $0.17 versus prior guidance of $0.16.

Gap (NYSE:GPS) posted a 9% comps gain, better than the expected 8.1%, and increased Q2 earnings guidance to $0.20-$0.22. Analysts had been looking for $0.18. Women's retailer Ann Taylor (NYSE:ANN) also beat same-store expectations and raised guidance. July comps grew by 7.6%, and Ann Taylor now anticipates Q2 earnings between $0.44-$0.45, versus analysts' projections of $0.41.

Abercrombie & Fitch (NASDAQ:ANF) was one standout that missed same-store sales predictions by a wide margin yet still said it would beat quarterly estimates. The collegiate retailer's July comps declined by 11%. Analysts expected only a 4.4% drop. Thanks to its tight inventory and cost controls, however, Abercrombie expects to beat the $0.32 per share consensus estimate for its Q2.

All eyes will now be on the upcoming back-to-school season to see if retailers can sustain July's momentum.

LouAnn Lofton owns shares of Gap and Abercrombie & Fitch. The Motley Fool has a disclosure policy.