Lisa Poole, Associated Press
In this Tuesday, Feb. 17, 2009, file photo, shoppers leave a Wal-Mart in Danvers, Mass. Wal-Mart Stores Inc. eked out a rare gain in an important sales measurement in the third quarter as it reported profits that beat Wall Street expectations Thursday.

BENTONVILLE, Ark. — Wal-Mart Stores Inc. eked out a rare gain in an important sales measurement in the third quarter as it reported profits that beat Wall Street expectations Thursday.

But the world's largest retailer issued a fourth-quarter profit outlook that missed Wall Street expectations because of expected fierce holiday discounting. The quarter also marked two full years of traffic declines at U.S. Wal-Mart stores.

Wal-Mart is a barometer of consumer spending and its challenges reflect the struggles of its low-income shoppers, who are being squeezed by stagnant wages and reduced government food stamps. It's also facing fierce competition from online king Amazon.com, dollar stores and grocers.

The company is also wrestling with its own mistakes, like problems in its fresh produce area and not restocking items on shelves fast enough.

Last month, Wal-Mart told investors it was addressing the problems at Wal-Mart U.S. stores, which account for 60 percent of the company's revenue.

At the same time, it is scaling back its expansion plans for its supercenters next year and stepping up investments of its online operations.

To win its share of its holiday dollars, Wal-Mart announced an aggressive holiday plan that includes free shipping on the top 100 items and price cuts on 20,000 items. Starting Friday, Wal-Mart will start to match its online prices with Amazon.

"Being the price leader is an ongoing priority for us and a commitment to our business," said Doug McMillon, who took over as CEO in February. "And with every year, that is even more important during the holiday season."

He added that while he's encouraged by the sales increase at its Wal-Mart stores, he's still not satisfied with the performance.

"We need to continue to improve the customer experience, both in our stores and online, to deliver stronger sales growth and strength our bottom line performance," McMillon said in a transcript of a prerecorded call to investors.

Wal-Mart reported earnings of $3.71 billion, or $1.15 per share, for the three months that ended Oct. 31.

The company, which is based in Bentonville, Arkansas, posted revenue of $119 billion in the period, beating Wall Street forecasts. Analysts expected $118.35 billion, according to Zacks.

Wal-Mart's U.S. discount division posted a 0.5 percent increase in revenue at stores open at least a year. That was the first increase in seven quarters.

Its smaller Neighborhood Markets, which cater to shoppers looking for more convenience and offer groceries, fresh produce and beauty items, had a 5.5 percent increase in revenue at stores open at least a year.

Wal-Mart said that it expects fourth-quarter earnings per share to range between $1.46 and $1.56, which includes the negative impact of closing underperforming stores in Japan. Analysts had expected $1.57 per share.

The company expects full-year earnings to be $4.92 to $5.02 per share. Analysts had expected $4.99, according to FactSet.

Shares of Wal-Mart rose more than 2 percent to $81 in premarket trading.

Elements of this story was generated by Automated Insights (http://www.automatedinsights.com/ap ) using data from Zacks Investment Research.