NEW YORK (CNNMoney.com) -- Sizzling temperatures combined with the countdown to the new school year worked in retailers' favor last month, helping to boost sales of summer merchandise and consumables at both specialty stores and discounters last month.

According to Ken Perkins, research analyst with Retail Metrics, 56 percent of the universe of 64 retailers he tracks on a monthly basis beat sales expectations while 44 percent missed. "We were expecting it to be the other way around," he said

Among the retailers who Thursday reported July sales at their stores open at least a year - a key retail measure known as same-store sales - teen merchants saw a mixed performance.

However, others in the space had a more challenging month. Sales at Hot Topic (Charts), seller of Goth and music-inspired clothing and accessories, fell 7.2 percent, while sales at Pacific Sunwear (Charts) tumbled 10.6 percent, forcing the retailer to issue a fiscal second-quarter profit warning.

Pacific Sunwear now expects to post a profit of between 14 to 15 cents a share for the period. Analysts had expected the retailer to log a profit of 20 cents a share for the period, according to First Call.

Sales at wholesale club operator Costco (Charts) topped expectations. The company posted a 7 percent sales gain last month versus expectations for a 6.8 percent increase.

Despite some concerns about back-to-school shopping getting off to a late start, July turned out to be a pleasant surprise, said Retail Metrics' Perkins.

"A lot of companies beat their sales expectation," said Perkins. "The weather boosted sales of summer products. The other catalyst was fashion newness. This really helped some retailers like American Eagle."

At the same time, Perkins said the state of the economy and higher prices at the pump makes him somewhat cautious about August and the fall holiday shopping season.

"As long as the job picture holds, that will keep a floor under consumer spending," he said. "But the macroeconomic indicators are going in the other direction. The cost of of credit card and home equity borrowing is becoming more expensive, housing is coming in for a hard landing. All this is hanging over everyone's head and could mean a challenging spending environment to come."

Retail Forward economist Steve Spiwak agreed.

"Weaker job gains, a volatile job market and higher home cooling bills are creating heightened uncertainty among consumers," Spiwak wrote in a note Thursday. "Also, consumer angst has been boosted by the housing market slowdown, which is sapping some demand across all the key income segments."

Upbeat month for Wal-Mart

Wal-Mart, (Charts) the No. 1 retailer, reported July sales rose 2.4 percent, at the high-end of its 1 to 3 percent forecast.

Its results were in-line with its previous guidance for the month. Tom Schoewe, Wal-Mart's chief financial officer, attributed the better-than-expected results to back-to-school promotions on clothing and dorm essentials, as well as a pick-up in purchases of food and beverage products.

"The timing for our back-to-school promotion was the same as last year and we achieved positive sales results in school supplies for the month, with strength in crayons, pencils and theme notebooks. In apparel, school uniforms, screened T-shirts, fashion denim and shorts have done well," Schoewe said.

For August, the retailer expects comparable sales to be up between 1 to 3 percent.

Meanwhile, sales at Target (Charts), the No. 2 discounter after Wal-Mart, rose 3.1 percent, missing analysts' projections for a 4 percent increase, according to First Call.

The retailer last month had lowered its sales forecast, saying it anticipated an increase of between 3 percent to 4 percent, down from its initial estimate of 4 percent to 6 percent growth. The retailer cited gas price inflation as one factor weighing negatively on its consumers.

Pier 1's sales plunged 14.9 percent in July, making the 10 month out of the past 12 months that the retailer has reported negative comparable sales.

The company blamed the shortfall on poor traffic trends in its stores and an overall weak environment for the home furnishing space. For August, the company said it hoped greater promotional activity and a renewed marketing push would help correct the declines.

Sales at the Gap fell 4 percent, marking the 11th out of the past 12 months that the retailer has reported sales declines.

Gap has struggled to hit the right fashion trends for some time. In June, the company announced it was initiating a substantial makeover of all of its namesake U.S. stores, and that it would relaunch its TV ads in a bid to win back customers and revitalize its sagging sales. Gap's ongoing problems continue to fuel speculation about the company potentially becoming a leveraged-buyout target.

Separately, a new report from market research firm ComScore Networks projected total online spending this year could reach $170 billion, up from $143.2 billion in 2005. The report suggested that the online channel has largely been unaffected by the economic headwinds impacting the overall retail sector.