Just when you thought things couldn't get any worse for Rite Aid (RAD 25.00%), they did.

The pharmacy chain's stock has taken a beating throughout 2017 with increasing uncertainty over a now-scrapped acquisition by Walgreens Boots Alliance (WBA 0.59%). The drubbing got even worse on Thursday, with Rite Aid announcing its fiscal 2018 second-quarter results. Rite Aid stock traded more than 10% below its previous close soon after the market opened. Here are five key things you need to know from the company's quarterly update. 

Pharmacist holding hands out with unhappy customer

Image source: Getty Images.

1. Why revenue fell

Probably the worst news for Rite Aid in the second quarter was that total revenue dropped more than 4% year over year to $7.7 billion. The consensus analysts' estimate was for the company to post second-quarter revenue of a little over $7.8 billion.

The biggest reason for Rite Aid's $350 million revenue decline was lower retail pharmacy sales. The company reported lower prescription volume and a decrease in same-store front-end sales. In a nutshell, business worsened throughout the retail pharmacy segment.

Rite Aid CEO John Standley pointed to two reasons for the weakness. First, he said the company continues to be hurt by reductions in reimbursement rates for drugs. Rite Aid hasn't been able to offset those reductions with efficiencies in purchasing generic drugs. Second, Standley thinks his company has suffered as a result of "an extended merger and asset sale process." There's also a third factor: Rite Aid is no longer included in some pharmacy networks in which it participated in the past.

2. Profitable -- but with a catch

At least Rite Aid reported a profit in the second quarter of $170.7 million, or $0.16 per diluted share. That's a big improvement from the $14.8 million, or $0.01 per share, net income posted in the same quarter last year. And it's way better than the big losses Rite Aid reported in the prior two sequential quarters.

Don't get too excited, though. That second-quarter profit comes with a catch. Rite Aid received $325 million from Walgreens as a result of the proposed merger being terminated. 

3. Bottom line actually worsening

That leads to the third thing to know about Rite Aid's latest results: The bottom line is actually getting worse. Rite Aid's adjusted net income reveals a better picture on what's happening with the company. In the second quarter, the pharmacy chain reported an adjusted net loss of $15.6 million, or $0.01 per share. Rite posted adjusted net income of $36.4 million, or $0.03 per share, in the prior-year period.

The deteriorating bottom line could have been even worse. Rite Aid benefited in the second quarter from a reduction in adjusted income tax expense and depreciation and amortization expense. In addition, the company has done a pretty good job at controlling costs.

4. EnvisionRx treading water

Most of the discussion about Rite Aid focuses on its stores. However, the company also operates a pharmacy benefits manager (PBM), EnvisionRx. Unfortunately, the PBM is essentially treading water.

Revenue for EnvisionRx in the second quarter declined 8.7% year over year to $1.5 billion. That drop stemmed from fewer covered lives at Envision Insurance Company. However, EBITDA for the PBM was flat year over year, with the decrease in revenue offset by higher gross profit from a change in client mix.

5. Shrinking even before the Walgreens deal

Walgreens is buying 1,932 stores from Rite Aid. Stores will begin transitioning to Walgreens in October and be completed in the spring of 2018, leaving Rite Aid as a much smaller company going forward. The reality, though, is that Rite Aid is already shrinking a little. In the second quarter, the company opened one new store but closed 17 stores, for a net reduction of 16 stores.

This isn't necessarily bad news, however. It's smart for Rite Aid to shut down stores that either aren't profitable or are barely profitable. In fact, one good thing about the Walgreens sale is that Rite Aid should increase its profitability per store, because Walgreens is getting some of the lower-profitability stores. 

Looking ahead

It's too early to know how well Rite Aid will perform after divesting the large number of stores to Walgreens. The company's revenue will be much lower, of course. However, retaining stronger stores, along with the opportunity to use Walgreens' network for purchasing generic drugs, could help improve Rite Aid's bottom line. A dramatic reduction in debt will also help significantly toward that goal.

I have argued that Rite Aid could be a bargain at its current valuation. However, much of that argument is based on the potential of a third party buying Rite Aid. Whether or not that actually happens remains uncertain. It's possible that the situation continues to get worse for Rite Aid before it gets better.