The acquisition, first reported earlier in the day, would combine two of the largest U.S. drugstore chains. The price represents a 48 percent premium to Rite Aid's closing price on Monday.
The deal's total enterprise value is $17.2 billion, including acquired net debt. The companies expect it to close by the second half of next year.
"This combination will generate a stronger base for sustainable growth and investment into Rite Aid stores, while realizing synergies over time," said Walgreens Boots Alliance CEO Stefano Pessina in a statement.