(Reuters) - A slimmed-down Rite Aid Corp RAD.N could lose much of its bargaining heft with insurers and makers of branded drugs at a time when it is trying to turn around its flagging pharmacy business, analysts said.

A sign marks a Rite Aid pharmacy in Somerville, Massachusetts, U.S., June 29, 2017. REUTERS/Brian Snyder

Rite Aid said on Thursday it would sell nearly half its U.S. stores to larger rival Walgreens Boots Alliance Inc WBA.O after the drugstore operators agreed to scrap a whole-sale merger.

Wall Street showed its displeasure at the new deal, pushing Rite Aid’s shares down 30 percent to a near four-year low after the announcement. The stock added to its losses, falling 7 percent on Friday.

Rite Aid has been struggling with eroding profits in its pharmacy business, which sells prescription drugs, as increases in branded drug prices have slowed while reimbursement pressure for generics has intensified.

“I think Rite Aid is going to struggle to remain relevant in the pharmacy industry,” said Adam Fein, president at Pembroke Consulting, which tracks the drug distribution industry.

“The pharmacy industry has become hyper competitive and it favors either large teams or nimble independents, and Rite Aid is buck in the middle and doesn’t have geographic scale anywhere, except in the North East and the West Coast.”

But it’s not all bad news for the company.

Under the new deal, Rite Aid will gain access to Walgreen’s centralized sourcing system, allowing it to procure generic drugs at low costs for 10 years and giving its pharmacy margins a much-needed boost.

Walgreens, the No. 1 drugstore chain in the country, has a sourcing contract with AmerisourceBergen Corp ABC.N, the second-largest U.S. drug distributor, giving the alliance bargaining clout against drugmakers.

“We estimate more favorable generic procuring costs could provide 3-5 percent of saving on RAD’s total generic spend,” Cowen & Co analyst Charles Rhyee said in a research note.

LEANER AND MEANER?

Still, being left with only half its stores will be punishing on economies of scale for Rite Aid, which is already struggling to turn a profit, said Neil Saunders, managing director of market research firm GlobalData Retail.

Rite Aid on Thursday posted a much bigger quarterly loss, mainly because of a drop in same-store sales due to low reimbursement rates. This was the company’s third loss in the past five quarters.

EBITDA margins for the company fell to an average of 3.4 percent in fiscal 2017 ended March 31, from 4.8 percent in 2013.

In contrast, Walgreens’ EBITDA margins have averaged 7.3 percent on average for first three quarters of fiscal 2017, which ends in August, from 6.9 percent for the whole of 2013.

Rite Aid, however, said the deal would make it a smaller but stronger company, helping it address pharmacy margin challenges and significantly cut its debt - over $7 billion at the end of fiscal 2017.

Selling roughly half its stores will leave Rite Aid more reliant on its pharmacy benefit management business, which maintains formularies, or preferred drugs lists, negotiates rebates with drugmakers, and processes prescription drug claims.

“We think this will benefit RAD from a valuation perspective as we estimate that PBMs trade at a premium to drug retailers, by about a couple of turns in our view,” Cowen & Co analyst Charles Rhyee said in a research note.

The smaller company could also be an attractive buyout target for a private equity firm or a rival such as Fred's Inc FRED.O, which was to buy some assets that would have been divested under the previously planned Walgreens-Rite Aid merger, analysts said.