Albertsons Cos. plans to buy the rest of Rite Aid Corp. that isn’t being sold to Walgreens Boots Alliance Inc. as retailers of all stripes scramble to respond to a rapidly changing consumer shopping landscape. The drugstore chain and Albertsons have a combined value of around $24 billion, including debt, the companies said Monday. Rite Aid RAD, +2.40% , which comprises thousands of drug stores and a benefits-management company with millions of members, has a market value of about $2.3 billion and is in the process of selling a chunk of its stores to Walgreens WBA, +1.63% . Following the proposed cash-and-stock deal, shareholders of closely held Albertsons, owner of Safeway and 19 other supermarket chains, would hold roughly 71% of the combined company, while Rite Aid investors would own the rest, they said. The transaction would create a company with revenue of $83 billion and allow Albertsons to go public after more than a decade of ownership by private-equity giant Cerberus Capital Management LP. The grocer was on the brink of an initial public offering in 2015 but shelved the plan in the face of a dour profit forecast by rival Walmart Inc WMT, +1.50% . An expanded version of this story can be found at WSJ.com