Grocery chain Albertsons announced plans Tuesday to acquire Rite Aid in a cash and stock deal, as the traditional grocery industry continues to look for growth by broadening offerings, not just store base.

A combined Albertsons and Rite Aid would have a value of roughly $24 billion, including debt. When the deal closes, Albertsons shares will trade on the New York Stock Exchange. Albertsons in 2015 filed an IPO it had hoped would value it at as much as $24 billion, including debt, but it canceled that plan.

This deal follows Rite Aid's failed attempt in 2015 to sell to its 4,600 stores to Walgreens. That deal was whittled down by regulators to a purchase of 1,932 stores for $4.37 billion.

Rite Aid has a market value of $2.31 billion. The combined company is expected to have roughly $14 billion in net debt, according to credit ratings firm Moody's. That figure could vary depending on how shareholders choose to be compensated for the deal.

Upon the deal's closing, Rite Aid will own up to a 29.6 percent stake in the combined company and current Albertsons shareholders will own up to 72 percent.

The new company's revenues would be about $83 billion.

Rite Aid Chairman and CEO John Standley will become CEO of the combined company, and Albertsons chairman and CEO Bob Miller will be chairman of the new company.

Shares of Rite Aid were up 1.2 percent in late morning trading after skyrocketing as much as 30 percent before the opening bell.

The deal with Albertsons underlines the change in course that retailers are taking, no longer looking to expand only by real estate footprint, but also by capability. Increasingly, retailers are looking to pharmacies for this expansion, which can take advantage of the frequency with which people buy prescription drugs. There is also the opportunity to use store footprints as a base for drug delivery and pick up.

CVS Health late last year announced its intent to acquire Aetna for roughly $69 billion. Walgreens is now said to be in early-stage talks to acquire drug wholesale company AmerisourceBergen, The Wall Street Journal has reported.

These moves come as the health-care sector itself is under pressure. Amazon recently announced plans to team with Berkshire Hathaway and J.P. Morgan to craft a start-up to lower employee health costs.