Like the series finale of a long-running TV drama, the final act in the deal between Rite Aid Corporation (RAD 5.56%) and Walgreens Boots Alliance (WBA -0.06%) had one last plot twist.

The U.S. Federal Trade Commission (FTC) approved an agreement for Walgreens to buy 1,932 stores along with three distribution centers and related inventory from Rite Aid for $4.375 billion. That's fewer stores than Walgreens' previous bid for 2,186 stores. The price tag is also lower than the previous $5.175 billion offer. But the drama is now finally over. 

Rite Aid will emerge from the sale of stores to Walgreens as a very different company with different prospects than it would otherwise have. Should you buy Rite Aid stock now that the deal is done?

Buy decision chart with calculator and pen

Image source: Getty Images.

The Rite Aid of the future

Even with the reduced number of stores being sold to Walgreens, the Rite Aid of the future will be much smaller than it is now. The pharmacy chain will operate roughly 2,600 stores and six distribution centers. Rite Aid will also continue to run its EnvisionRx pharmacy benefit manager business, RediClinic walk-in healthcare clinics, and Health Dialog population health management services provider. 

With fewer stores, Rite Aid's revenue will obviously be lower than in the past. However, there's a good chance that the company will become more profitable when all is said and done. Prior to the reduction in stores being purchased by Walgreens, Rite Aid stated that the stores that it would retain generated higher sales per store and greater profitability than what the company currently achieves. That still appears to be the case based on CEO John Standley's comment that Rite Aid will now have a "more profitable store footprint in key markets." 

Another provision in the Walgreens deal could also boost profitability for Rite Aid. As with the previous iteration of the agreement, for the next 10 years Rite Aid will be able to buy generic drugs through Walgreens Boots Alliance's network at a similar cost to what Walgreens pays. This is important, especially since Rite Aid will be smaller and have less negotiating leverage with drug distributors.

One other thing about Rite Aid will be much smaller after the Walgreens deal: the company's debt. Rite Aid's debt currently stands at more than $7.2 billion. The company should net around $3.9 billion from Walgreens' purchase (after fees and taxes) to pay down debt. Assuming that Rite Aid does apply this amount to its debt as the company's executives have stated would happen, Rite Aid's debt after the dust settles will be in the ballpark of $3.3 billion. 

Reasons to buy -- and to stay away

There's one overarching reason why some investors would consider buying Rite Aid stock now: They view it as a bargain. I think they're right.

Walgreens is buying those 1,932 stores at a price tag of roughly $2.2 million each. After the big sell-off following the news that the terms of the deal had again changed, Rite Aid's market cap stands at $2.5 billion. Divide that market cap by the 2,600 remaining stores. That gives a current valuation of only around $960,000 per store. Are Rite Aid's stores worth more than that? I'd say they are.

Jigsaw puzzle piece with "price" written on it next to matching hole with "value" written on it

Image source: Getty Images.

Remember, these stores are more profitable than the ones that Rite Aid is selling to Walgreens. Also, earlier this year Fred's (FRED) was willing to pay close to $1.1 million per location to buy 865 Rite Aid stores. That was part of a deal to help make Walgreens' original plan to acquire Rite Aid more palatable to the FTC. My view is that Fred's was getting a good bargain at that price.

Some investors might also believe that Rite Aid's earnings will improve after the Walgreens transaction finalizes. If the company returns to growth, Rite Aid stock could turn out to be the textbook value investor play. Could this happen? It's possible. After all, Rite Aid will have substantially less debt, which means lower interest expense, more profitable stores, and access to Walgreens' lower costs for generic drugs.

There's also some big reasons for investors to stay away from Rite Aid: the risks. First is the risk that the company won't be as successful as hoped. Rite Aid will still compete against Walgreens and CVS Health (CVS -0.62%), but will be smaller. The headwinds that the company faces won't disappear overnight after the sale of stores to Walgreens concludes.

For investors who believe Rite Aid could still be acquired, the risk is that simply won't happen. CVS Health could be a potential buyer, but after the ordeal that Walgreens experienced with the FTC, it wouldn't be surprising if the big pharmacy services company took a pass on Rite Aid. Private equity investors might be a more likely suitor, but they could decide there are better opportunities elsewhere.

More drama

Back to our original question: Should you buy Rite Aid stock? The answer is that it depends on what kind of investor you are.

Rite Aid has nothing to offer to income investors. It's not a good fit for growth-oriented investors. To be interested in Rite Aid, you need to be a value investor. Not only that, you need to be a value investor who is willing to potentially wait a long time for Rite Aid to either turn things around or be acquired. If you're that type of investor, buying Rite Aid stock could be a good move. Remember, though, that while the saga with Walgreens is coming to an end, the drama for Rite Aid will definitely continue.