The retail pharmacy business isn't what it used to be. Competition is fiercer than ever. E-commerce is changing how businesses operate. But two of the biggest players in the retail pharmacy market are rolling with the punches relatively well. CVS Health (CVS -0.93%) and Walmart (WMT 1.17%) have made aggressive moves to remain relevant in the changing retail pharmacy industry.

Walmart has delivered bigger gains to investors in recent years. But CVS Health's acquisition of giant health insurer Aetna holds the potential to shake things up. Which is the better stock for long-term investors? 

Female customer with a shopping basket standing in a pharmacy aisle

Image source: Getty Images.

The case for CVS Health

CVS Health is really three big businesses rolled into one. The company's retail/long-term care segment includes its retail pharmacy stores plus its Omnicare pharmacy business that serves assisted living facilities, nursing homes, and other long-term care settings. Its pharmacy services segment primarily includes the CVS Caremark pharmacy benefits management business. And there's the healthcare benefits segment, which includes Aetna and CVS's Silverscript Medicare Part D plans.

Probably the biggest reason to consider buying CVS Health stock is the opportunity for the company to offer innovative new healthcare products that leverage its scope of operations across healthcare. One way CVS Health thinks it can win is by introducing programs for Aetna members that drive higher sales for its retail pharmacy business. For example, the company's pilot program of the NovoLogic technology platform hopes to increase medication adherence for Aetna members, which should boost prescription volumes at CVS pharmacies.

One pilot program that has been quite successful for CVS Health is its HealthHUB concept. HealthHUB stores offer healthcare services and technology solutions to customers including health kiosks and "care concierges" to help find needed healthcare products and services. CVS Health piloted a few HealthHUB locations earlier in 2019 and now plans to convert 1,500 stores to HealthHUB locations by the end of 2021.

Even without these innovations, CVS Health is growing. The company reported solid third-quarter results in early November with across-the-board sales growth. While the addition of Aetna made CVS Health's year-over-year comparisons look really great, the company's existing businesses also performed well.

CVS Health stock could look like a bargain to some investors. Its shares currently trade at close to 10.6 times expected earnings.

The company has suspended its nice dividend hikes from previous years as it attempts to pay down debt resulting from the acquisition of Aetna. However, CVS Health's dividend yield of nearly 2.7% should be quite attractive to most investors.

The case for Walmart

Walmart, of course, is a retail powerhouse with its reach extending well beyond pharmacy. But don't dismiss Walmart as a serious competitor in the retail pharmacy market. It ranked as the No. 5 pharmacy chain in the U.S. last year based on total prescription revenue.

The company's core retail business continues to fire on all cylinders. Walmart reported a year-over-year increase in same-store sales at its U.S. stores of 3.2% in the third quarter. Customer traffic grew as well as average spending per customer.

Walmart has also really stepped up its game in e-commerce. The company announced a 41% year-over-year increase in e-commerce sales in Q3. Online grocery is especially boosting growth. Walmart now offers grocery delivery and "pickup towers" in 1,400 stores.

The company is also moving into a new arena. Walmart is rolling out a lineup of home improvement and lawn and garden products under the Hart brand. This positions the retailer to go head-to-head against home improvement leaders Home Depot and Lowe's

Walmart stock could look a little pricey at current levels, though. Shares are trading above 23 times expected earnings. 

Investors should be pleased that the retail giant remains solidly committed to its dividend program. Walmart's dividend yields nearly 1.8%. The company has boosted its dividend for 46 consecutive years and will almost certainly keep that impressive streak going for a long time to come.

Better buy

I think that Walmart will be able to deliver stronger growth over the long run than CVS Health will. My view is based primarily on what I see as Walmart's greater optionality -- the ability to generate growth through multiple pathways. I also believe that Walmart is in a better position to defend itself against the threat posed by Amazon.com. And despite CVS Health's higher yield, Walmart's track record makes it one of the more attractive dividend stocks in the retail sector.

But while I view Walmart as the better pick over CVS Health, I'm not enamored of either of these stocks right now. In my opinion, there are way too many other stocks to buy that offer even better growth prospects than Walmart or CVS Health.