What happened

Shares of Rite Aid Corporation (RAD 20.00%) took a dive today after the company's agreement to sell a chunk of its stores to Walgreens Boots Alliance (WBA 3.69%) was finally approved by the Federal Trade Commission but with fewer stores than previously stipulated.

Walgreens will now take over 254 fewer stores, or 1,932 in total, and pay $800 million less, or $4.38 billion. The deal will leave Rite Aid with about 2,600 stores. As of 11:18 a.m. EDT, Rite Aid's stock was down 9.2%, while Walgreens' was off 1.8%.

A pharmacist stands behind a drugstore counter.

Image source: Getty Images.

So what 

News that the feds finally approved a deal between the two drugstore chains after two years of negotiations would seem to be a good thing for Rite Aid, but the country's No. 3 pharmacy chain is actually getting a lower price per store in this agreement.

Walgreens is paying $2.27 million for each of the 1,932 stores, which includes three distribution centers and related inventory. In the previous agreement made in June, Rite Aid was going to sell 2,186 at an average price of $2.37 billion.  The slimmed-down deal also gives Rite Aid less money to pay down its substantial debt burden and invest in its remaining stores. Walgreens investors may be disappointed that it's getting fewer stores than it would have. Originally, Walgreens had sought to acquire Rite Aid outright.

Now what

Rite Aid CEO John Standley said the deal would result in "a compelling and more profitable store footprint in key markets, enhanced purchasing capabilities and a stronger balance sheet and improved financial flexibility." 

Transfer of the stores will begin in October and is expected to be completed by the spring of next year. From there, the hard work of repairing the business will start. Most of the cash influx will be used to pay off its $7.2 billion debt burden, and Rite Aid should benefit from a part of the agreement that allows it to purchase generic drugs through Walgreens. Expect Rite Aid shares to remain volatile through the transition.