Rite Aid's

(RAD) - Get Report

posted a narrowed second-quarter loss, helped by strong pharmacy sales, and the drugstore chain backed its guidance for the year.

The company said Thursday that its second-quarter loss shrank to $330,000 from $1.6 million a year earlier. On a per-share basis, which includes the effect of preferred dividends, the loss narrowed to 2 cents from 3 cents. Analysts polled by Thomson First Call expected a loss of 2 cents a share.

Rite Aid's revenue rose to $4.29 billion from $4.13 billion, narrowly topping Wall Street's estimate of $4.25 billion.

Same-store sales climbed 3.8% from a year earlier, consisting of a 4.7% rise in pharmacy same-store sales and a 2.3% rise in front-end same-store sales.

"We're very pleased with our second quarter," said Mary Sammons, Rite Aid president and CEO, in a press release. "Our positive performance trends continued with a strong increase in pharmacy sales, good prescription count growth and solid front end sales gains.

For the full fiscal year, Rite Aid still sees results ranging from a loss of 7 cents a share to earnings of 2 cents a share. The company expects sales of $17.40 billion to $17.65 billion, with same-store sales growth of 2% to 4%. Analysts, on average, expect break-even results and revenue of $17.5 billion.

Last month, Rite Aid agreed to acquire all Brooks and Eckerd stores in a deal valued at about $2.63 billion at the time. After the deal closes, the number of Rite Aid stores will surpass 5,000 nationwide in 31 states.