With Amazon.com Inc. (AMZN) eyeing healthcare and drug retailing, retailer Albertsons Cos. is pushing back and gearing up to acquire the parts of Rite Aid Corp. (RAD) that aren't going to Walgreens Boots Alliance Inc. (WBA).

Citing the companies, The Wall Street Journal reported that combined, Albertsons and Rite Aid will be valued at around $24 billion. Rite Aid is currently selling a large part of its business to Walgreens and operates thousands of drug stores around the country. The deal would enable Rite Aid to grow its business in the face of a move by the federal government to prevent a full sale of the company to Walgreens. As a result of government opposition, Walgreen is acquiring around 2,000 Rite Aid drugstores.

Under the deal, Albertsons shareholders would get 71% of the combined company with the rest of the ownership going to Rite Aid shareholders. The company would have $83 billion in revenue and would pave the way for Albertsons to launch an initial public offering, the Journal reported. The new company will have around 4,900 stores and 4,300 pharmacies located in 38 states and Washington, D.C. The companies have not decided what the new name of the combined company will be. (See also: Rite Aid Tanks on Walgreens Deal: Time to Buy?)

Competition on Multiple Fronts

In an interview, the CEOs of both companies told the Journal that the deal will enable it to better compete against Amazon, which is entering the drug market. It is already encroaching on Albertsons business with its purchase last year of organic food retailer Whole Food Markets. The executives also cited Walmart Inc. (WMT), which has been investing in its online offerings and speedier delivery. “We know that scale matters,” Albertsons CEO Bob Miller told the newspaper. “We continue to grow to compete with all competitors, not just Amazon.” (See also: Amazon Has Wholesale Pharmacy Licenses in 12 States: Report.)

Meanwhile, Rite Aid CEO John Standley said the deal would enable the drugstore operator to expand the number of food items it offers and differentiate it from Walgreens, Walmart and CVS Health Corp. (CVS) while at the same time increase Rite Aid’s online offerings. Standley will be the CEO of the combined company while Miller will be chairman.

Albertsons and Rite Aid aren’t the only two retailers that were prompted to engage in a deal in recent months to push back against Amazon. CVS’s $66 billion offer made for health insurer Aetna Inc. (AET) in October was prompted in part by concerns that Amazon was readying a push into the world of pharmaceutical drugs. With expectations growing in the fall of 2017 that the Seattle-based e-commerce giant was planning to enter the market as a wholesale distributor, CVS started looking for ways to counter that, and acquiring a major health insurer was among the strategies presented to company directors. It's not just drugstore operators that will be threatened by Amazon’s move into the pharmaceutical industry. It could also impact drug wholesalers and pharmacy benefit managers that negotiate drug prices for insurers. More recently Amazon announced it was teaming up with JPMorgan Chase and Berkshire Hathaway to create a new kind of health care company.

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.