OK. Retail drugstore chain Rite Aid Corporation (NYSE: RAD ) has had a rough six months. RAD stock has declined a staggering 63% so far this year, and many analysts are looking for shares to keep digging a hole deeper into the ground.

An increasing lack of confidence in a merger with Walgreens Boots Alliance Inc. (NASDAQ: WBA ) — recently capped by reports saying that the Federal Trade Commission (FTC) is looking to block the pairing — is the clear and obvious culprit.

But while things look far from great for Rite Aid, I stand firm behind my view that the market’s reaction to the failing merger is overdone.

Price Doesn’t Reflect Value

RAD stock currently trades around $3.10 per share. Investors who believed the WBA deal would happen have mostly abandoned the stock after the reports concerning the FTC’s stance.

However, the market’s panic over a failed deal has also caused them to overstate the problems within Rite Aid itself.

Rite Aid isn’t sparkly, that much is true. The firm is sitting on a sizable debt load of more than $7 billion that has been growing at a dizzying rate over the past few years. Rite Aid is also a clear No. 3 vs giants Walgreens and CVS Health Corp (NYSE: CVS ), and has struggled to compete with its larger rivals.

But let’s be realistic.

Before the merger was announced, RAD stock traded at nearly $7 per share. Even if you want to say that the market was pricing in some sort of potential for a buyout — let’s say a 25% premium — Rite Aid still belonged in the mid-$5 region?

Disappointment has turned into desperation and panic.

Management has admitted that the WBA merger, which has dragged on much longer than expected, has weighed considerably on the firm’s progress. The company hasn’t been able to make the investments in the business it needs to because everything has been put on pause. But the reports indicate the dust is about to settle. That’s when we’ll see a phenomenon that’s common when a battered company with a dark looming cloud finally swallows its medicine once and for all — a relief rally in RAD stock, sparked by simply knowing the outcome.

That might be an emotional investing response, but it has at least one true driver in that a blocked deal will be the moment Rite Aid can pivot back toward the future.

Deal or No Deal?

It’s not over till it’s over. Technically, the Walgreens-Rite Aid merger could somehow spring forth from all of this, and if so, RAD stock will obviously go to the moon. Even at a reduced price of $7 per share, that’s more than a doubler. Not that many on Wall Street are holding out hope for this outcome.

What you might want to keep your eye on is the potential for a new deal.

Despite its challenges, Rite Aid could be a valuable acquisition for another firm — and clearly, it’s willing to sell.

If the WBA-RAD merger falls through, expect to see interest from mega-cap retailers, and potentially even the grocer space. The most interesting prospect, however, is e-commerce giant Amazon.com, Inc. (NASDAQ: AMZN ), which has been rumored to be working on its own pharmacy business.

At a valuation of $7 per share, we’re looking at a purchase price of about $7.35 billion for Rite Aid. Amazon isn’t as much of a cash cow as Big Tech brothers Apple Inc. (NASDAQ: AAPL ) and Microsoft Corporation (NASDAQ: MSFT ), but at $21 billion in cash and investments, AMZN has more than enough dry powder to snap up all of RAD stock. And by doing so, it would immediately gain a footprint of more than 4,600 locations across 31 states.

Not a bad starting point.

Bottom Line on RAD Stock

Don’t buy Rite Aid solely on the hopes that it will shock Wall Street and merge with Walgreens — the deal has dragged on too long, and every indication is that it’s a slim chance at best. Don’t buy Rite Aid solely on the hopes that Amazon or some other suitor will come a-knockin’ as soon as WBA is out of the picture, either. Again, that’s purely speculative.

But if you want to buy RAD stock on the idea that the market has gone too far and knocked its valuation to crazy levels despite its many blemishes — and quietly, in the back of your mind, hope for a buyout as an unexpected bonus — that’s at least a better justification.

Rite Aid is in dire straits, and the company’s chances of a turnaround without Walgreens are low. However, investors just want clarity at this point — and an official ax to the deal could be the thing that sparks at least a short relief rally.

As of this writing, Laura Hoy was long AAPL.