Rite Aid Corp posted a smaller-than-expected quarterly loss, helped by lower expenses and charges related to drugstore closings, sending shares up as much as 10 percent.

The results come a day after larger rival Walgreen Co posted a lower-than-expected profit as sales of nonprescription items disappointed. Drugstore chains have been hurt as consumers dial back discretionary spending in the weak economy.

Rite Aid is continuing to weather the economic storm that is impacting the sales of most retailers, Chairman and Chief Executive Mary Sammons said on a conference call. She said the economy doesn't appear to be headed for a solid recovery any time soon.

Raymond James analyst John Ransom said it was impressive that the company's quarterly earnings before interest, taxes, depreciation and amortization did not decline year-over-year for the first time in a year, and adjusted gross profit margins fell less than expected.

Results were well ahead of depressed investor expectations, he said in a research note. However, Ransom said same-store sales continue to weaken, and ongoing pharmacy margin pressure remains an issue.

Rite Aid reported a first-quarter net loss attributable to shareholders of almost $76 million, or 9 cents a share, compared with a loss of $98.5 million, or 11 cents a share, in the year-earlier quarter.

Analysts polled by Thomson Reuters I/B/E/S had expected a loss of 14 cents a share.

Sales in the quarter ended May 29 fell 2.1 percent to $6.39 billion, compared with $6.4 billion forecast by analysts.

Same-store sales fell 1 percent, including a decline of 1.3 percent in the front end, where general merchandise like milk, toothpaste and cosmetics is sold, and a decline of 0.9 percent in the pharmacy. Pharmacy sales included a hit of about 138 basis points from new generic introductions.

AFFIRMS FORECAST

President and Chief Operating Officer John Standley said that same-store sales of general merchandise are improving in June from May, but still lag last year.

Standley will become president and CEO following Wednesday's annual shareholder meeting as previously announced, and Sammons will remain chairman until the June 2012 meeting.

The company repeated its March forecast for a fiscal 2011 loss in the range of 41 cents to 65 cents a share. It expects sales of $25.2 billion to $25.6 billion, with same-store sales performing in a range of down 1 percent to up 1 percent.

Analysts expect a loss of 52 cents a share for the year on sales of $25.4 billion. Ransom said the better-than-expected results in the quarter make the mid-point of the forecast more achievable.

Rite Aid has more than 12 million members in its card-based loyalty program after an April 18 nationwide launch and is on track to meet or exceed its target of 15 million to 20 million members by the end of the fiscal year, Standley said.

It also launched a guarantee program in North Carolina, South Carolina and Georgia during the quarter, where patients who don't get their prescriptions within 15 minutes get a $5 gift card, he said.

Prescription counts in those markets rose more than 100 basis points due to the program and the company has been able to meet the time guarantee more than 90 percent of the time, Standley said.

Rite Aid shares rose as much as 10 percent, and were still up 7 cents, or 6.9 percent, at $1.08 in morning trading on the New York Stock Exchange.

Rite Aid shares are down 28 percent since the end of last year, compared with declined of 23 percent and 2.7 percent by Walgreen and CVS Caremark Corp , respectively.

(Reporting by Ben Klayman; Editing by Derek Caney, Dave Zimmerman)