As Bob Dylan once sang, "the times they are a-changin'." That's especially true today for the retail pharmacy industry. Acquisitions and new competitive threats have altered the landscape for pharmacy giants Walgreens Boots Alliance (NASDAQ:WBA) and CVS Health (NYSE:CVS).

CVS Health appears to be weathering these changes better than Walgreens based on the year-to-date performance of the two stocks. But which of these stocks is the better long-term pick for investors? Here's how CVS Health and Walgreens Boots Alliance stack up against each other.

Smiling pharmacist holds a pad and paper while standing next to a shelf filled with medicines.

Image source: Getty Images.

Growth prospects

Wall Street analysts don't expect either of these two companies to generate sizzling growth over the next few years. The consensus analysts' estimate for Walgreens Boots Alliance is for an anemic 1.66% average annual earnings growth rate. Analysts are a little more optimistic about CVS Health, projecting average annual earnings growth of 3.25%.

Both companies face continued headwinds from a tough reimbursement climate. However, CVS Health appears to be addressing those challenges better than Walgreens is, at least so far.

In its latest quarter, CVS Health reported year-over-year revenue growth of 35.2%, boosted by its acquisition of Aetna, along with adjusted earnings per share (EPS) growth of 11.8%. Walgreens announced a slight year-over-year revenue increase of 0.7% in its most recent quarterly update. The company's adjusted EPS beat analysts' expectations but still fell by 4% year over year.

CVS Health thinks that the addition of Aetna will enable it to, in the words of CEO Larry Merlo, "fundamentally transform the consumer health experience." The company plans to roll out new products and services that will help more effectively control healthcare costs. My view is that Aetna gives CVS Health an advantage over Walgreens in generating growth.

Dividends

It's a close contest between Walgreens Boots Alliance and CVS Health when it comes to dividends. Walgreens' dividend yield currently stands at 3.36% compared to a 3.16% yield for CVS Health.

Walgreens also appears to be in a better position to increase its dividend. The company is currently using less than 35% of its earnings to fund the dividend program, while CVS Health is using over 56% of its earnings on paying dividends.

CVS Health suspended its annual dividend increases with the acquisition of Aetna. As a result, Walgreens is more likely to increase its dividend over the next few years. 

Valuation

Which of these two pharmacy stocks is more attractively valued? It depends on the metric that you use.

CVS Health is a little less expensive based on forward-looking price-to-earnings (P/E). Its forward earnings multiple of 8.84 is well below the 9.1 multiple for Walgreens Boots Alliance. Walgreens, however, looks more attractive using enterprise value-to-EBITDA (earnings before interest, taxes, depreciation, and amortization), with a multiple of 9.21 to CVS Health's 11.21.

In my view, the tiebreaker is growth. CVS Health has better growth prospects, so it appears to have an edge in valuation.

Better buy

Although CVS Health's dividend isn't as strong as Walgreens' dividend is, the stock looks more appealing based on its growth prospects and its valuation. I also think that CVS Health has been more innovative than Walgreens in responding to the potential threat from Amazon.com, which could shake things up in the retail pharmacy market in the future.

That being said, Walgreens has shown that it can think outside of the box. For example, it recently announced the testing of drone delivery of products with Wing, a subsidiary of Alphabet. Customers will be able to order from 100 items and have the products delivered to their doorsteps within five to 10 minutes.

Still, I think that CVS Health is the better pick over Walgreens at this point. However, I'm not a fan of either stock. Investing in healthcare stocks comes with plenty of risks, with the potential for major drug pricing changes a big one right now. CVS Health relies on its pharmacy benefits management (PBM) business for over half of its total revenue. PBMs could be squeezed in the future with politicians seeking to lower drug prices.

My view is to sit on the sidelines with both of these pharmacy stocks. There are simply too many other stocks to consider that have better growth prospects, better dividends, and better valuations.