Lowe's Cos. reported a higher-than-expected quarterly profit on Monday, and its shares rose more than 6 percent as the home-improvement retailer said sales were improving in some regions despite the soft U.S. housing market.

The company, which ranks second behind Home Depot Inc., said difficult sales comparisons were starting to lessen, but still cut its full-year profit and sales forecast.

This was a solid quarter for Lowe's, gaining share in the market, beating expectations and keeping expenses tight, Credit Suisse analyst Gary Balter said in a research note.

Earnings rose 9 percent to $1.02 billion, or 67 cents a share, in the second quarter ended August 3, from $935 million, or 60 cents a share, a year earlier. Analysts had expected 61 cents a share, according to Reuters Estimates.

Sales rose 5.8 percent to $14.2 billion, aided by the opening of 26 new stores. Sales at stores open at least a year fell 2.6 percent, in line with the company's expectations of a drop of as much as 3 percent.

While falling sales and prices for housing have hurt the home improvement sector, Lowe's turned in better results than Atlanta-based Home Depot, which last week reported a 15 percent drop in quarterly earnings and a 2 percent sales decline.

We believe that (Home Depot is) still a few years away, at least, from providing the in-store experience to regain their share from Lowe's, Balter said in his note.

Lowe's called the current sales environment challenging as the soft U.S. housing market depressed results in some regions, but said it had gained market share in 15 of 20 product categories. It also said gross margin had improved on better management of imported products and distribution.

There are signs of improvement in certain areas of the country, Chairman Robert Niblock said during a conference call. For instance, he said the U.S. Northeast was showing signs of improving sales in big-ticket installations.

U.S. markets where housing hadn't accelerated much in recent years delivered positive same-store sales, Lowe's said. Areas where sales fell included California and Florida.

Balter said Lowe's exposure to the weakest housing markets was much lower than Home Depot's.

Lowe's forecast per-share profit for the full year in the range of $1.97 to $2.01, down from a May outlook of $1.99 to $2.03. Analysts were expecting $1.97, according to Reuters Estimates.

Lowe's said it expected full-year sales to rise about 6 percent, compared with a gain of about 7 percent forecast in May.

The Mooresville, North Carolina, retailer said it expected a third-quarter profit of 43 cents to 45 cents a share. Analysts have forecast 47 cents.

Lowe's shares were up $1.63, or 6.1 percent, to $28.50 in morning New York Stock Exchange trading, while Home Depot was up 59 cents, or 1.8 percent, at $33.90. Lowe's stock has fallen 8.5 percent so far this year, while Home Depot is down 15.6 percent.