As the population ages and rates of online shopping continue to rise, companies that can capitalize on the drug delivery market stand to earn billions.

Walgreens and FedEx plan to offer next-day prescription delivery for $4.99 per drop-off, the companies announced Thursday.

The service will require customers to enroll in text message alerts through the Walgreens Express service, which "allows patients to preview their cost, prepay for eligible prescriptions and choose between home delivery or express pickup in store." Same-day delivery is available in some markets, and Walgreens plans to expand the service in 2019.

"FedEx and Walgreens are empowering consumers to choose when and where they receive their orders," said Randy Scarborough, vice president of retail marketing, FedEx Services. "Just as FedEx package pick-up and drop-off services at Walgreens locations provide customers with much-needed convenience, the ability to ship prescription medication directly from Walgreens to their homes offers valuable flexibility to best meet individual needs and schedules."

Walgreens says its partnership with FedEx makes it the "fastest choice for next-day prescription delivery across the nation."

​The race to dominate the drug delivery market

Walgreens is one of several major companies vying to lead the drug delivery game.

In June, CVS Pharmacy began offering next-day drug delivery, also for $4.99 per drop-off. That same month, Amazon acquired PillPack, an online pharmacy that organizes prescription medication by the dose and delivers it to customers. The acquisition was the latest in Amazon's slow but steady move into the pharmaceutical industry, which also includes a partnership with Berkshire Hathaway and JPMorgan Chase to create an independent company geared toward providing innovative healthcare solutions to their U.S. employees.

Dominating the market would mean billions in profit for these companies, considering consumers are increasingly relying on online shopping to buy traditional goods, and because the country's elderly population is expected to double by 2050, meaning demand will likely only increase.