Shares of drugstore chain Rite Aid (RAD) - Get Report rose on Thursday after the company posted adjusted third-quarter earnings and sales that beat analysts' forecasts, and updated its fiscal 2020 outlook.

Rite Aid gained more than 8% after the company reported adjusted earnings of $6.29 million, or 12 cents a share, in the third quarter, vs. an adjusted loss of $7.88 million, or 15 cents a share, in the year-ago quarter. 

Analysts polled by FactSet had been expecting earnings of 2 cents a share. Sales came in at $5.27 billion for the quarter, slightly less than the $5.42 billion in sales it posted a year ago though slightly ahead of analysts' forecasts.

Same-store sales, measured by prescription volume, gained 3.7%. Adjusted earnings before income, taxes, depreciation and amortization from continuing operations was $134.2 million, or 2.5% of revenue.

Newly appointed CEO Heyward Donigan attributed the positive quarter to "prescription count growth and strong expense control."

The company also updated its fiscal 2020 outlook. Rite Aid currently expects revenue of between $21.5 billion and $21.9 billion in fiscal 2020, with same-store sales expected to range from flat to 1% over fiscal 2019.

It is forecasting a loss of between $235 million and $275 million, adjusted EBITDA of between $510 million and $550 million, and adjusted earnings per share of between zero and 56 cents. Analysts polled by FactSet are currently forecasting a 2-cent loss for Rite Aid's fiscal year. 

Shares of Rite Aid were up 8.19% at $8.32 in morning trading on the New York Stock Exchange.