Mr. Miller would serve as chairman of the combined company and John Standley, the Rite Aid chairman and chief executive, would be chief executive. The combined company would have headquarters in Camp Hill and in Boise, Idaho, where Albertsons is based.
The transaction is subject to regulatory and shareholder approval and is expected to close in the second half of the year.
The deal comes at a time when retailers and pharmacy operators are looking for solutions in an increasingly digital world.
Consumers are buying their goods on the internet and smaller retailers are facing pricing pressures from online giants, such as Amazon. Amazon made a push into the food business by buying the upscale grocery chain Whole Foods for $13.4 billion last year.
The business of distributing and selling pharmaceuticals is seeing dramatic changes as well.
The nation’s largest pharmacy operators have aggressively pursued mergers in recent years in order to control costs and increase their pricing power. CVS Health said in December that it would merge with Aetna, the health insurer, in a $69 billion deal that could potentially reshape the way health care is delivered in the United States. That deal came together after a federal judge blocked Aetna’s merger with its health insurance rival Humana last year.
Technology companies are also playing a role. Amazon recently teamed up with Berkshire Hathaway and JPMorgan Chase to form an independent health care company for their employees, in hopes of bringing innovation to health care in the United States.
Rite Aid had already been seeking greater heft by combining with Walgreens. But two years of negotiations were upended when United States antitrust authorities indicated last year that they were not likely to approve the combination of two of the nation’s biggest drugstore chains. They settled on the smaller, $4.4 billion deal for more than 1,900 stores and three distribution centers instead.
At the end of the third quarter, Rite Aid had about 4,400 locations after transferring a small number of stores to Walgreens. Earlier this month, Rite Aid said that it had transferred about 1,114 stores so far to Walgreens.
Under the terms of the transaction, Rite Aid shareholders would receive $1.83 in cash and one share of Albertsons stock for every 10 shares of Rite Aid they own. They also could opt to receive 1.079 shares of Albertsons stock for every 10 shares of Rite Aid they own.
The companies said they expect to save $375 million annually within about three years.
The latest transaction would boost the footprint of Albertsons, which operates more than 2,300 stores in 35 states and the District of Columbia under Albertsons, Safeway and other brands.
Albertsons, whose parent is owned by a consortium of investors led by Cerberus Capital Management, operates more than 1,700 in-store pharmacies as part of its business.
The Rite Aid deal is the latest transaction by Albertsons to expand its offerings to attract consumers.
The company reached an agreement with Instacart in November to provide on-demand grocery delivery services and invested last year in El Rancho Supermercado, a Texas-based retailer focused on stores for Latino customers.
Albertsons said it has $59.7 billion in annual sales. Rite Aid reported revenue of $32.8 billion in its most recent fiscal year, which ended in March.