The deal would combine the second and third largest drug-store operators and would intensify the already tough competition with CVS Health.
CVS has 58% market share in the pharmacy and drug-store business, Walgreens controls 31% and Rite Aid has 10%.
Walgreens said in a statement on Tuesday that it is paying $9 per share in cash in a valuation that includes the assumption of debt. That reflects a 48% premium above Rite Aid's value at the close of trading Monday.
On Wednesday, Deerfield, Illinois-based Walgreens reported fiscal fourth-quarter earnings, Excluding one-time items, were $0.88 per share. That surpassed the $0.81 average of analysts’ estimates compiled by Capital IQ
Revenue totaled $28.5bn, equaling analysts’ estimates.
The company’s pharmacies filled 222mln prescriptions in the quarter, up 4.6 percent from a year before.
The drugstore chain said it has saved $799mln this fiscal year from cost cuts,
Shares of Walgreens fell 1.9% to $95.16 as of 8:32 in premarket trades in New York.