Two giant pharmacy chains -- CVS Health Corporation (NYSE:CVS) and Walgreens Boots Alliance (NASDAQ:WBA) -- have been at the forefront of mergers and acquisitions activity over the last year. CVS Health announced plans to buy Aetna (NYSE:AET). Walgreens tried to acquire Rite Aid, but instead settled for scooping up a large chunk of the company's stores after running into regulatory roadblocks.

These moves haven't necessarily helped the stock performance for CVS Health or Walgreens, though. Both stocks are down close to 20% over the last 12 months. But what is the potential for these pharmacy stocks over the long term? And which stock is the better pick for investors? Here's how CVS Health and Walgreens Boots Alliance compare in three key areas.

Pills making dollar sign in red, white, and blue colors.

Image source: Getty Images.

Growth

Both CVS Health and Walgreens could benefit from demographic trends. As individuals age, they tend to take more prescription drugs. That presents opportunities for both companies' retail pharmacy businesses.

Which company is better positioned to take advantage of those opportunities? It's hard to say. Walgreens has outhustled CVS Health over the last 18 months, taking away a couple of big contracts from its rival. However, both CVS Health and Walgreens should be able to continue attracting customers in the future.

The two companies also have growth prospects outside of retail pharmacy. CVS Health operates one of the largest pharmacy benefits managers (PBMs) in the world. As mentioned earlier, the company also hopes to acquire Aetna, the fifth-largest health insurer in the U.S. Walgreens Boots Alliance ranks as one of the top wholesale pharmaceutical distributors, thanks to the 2014 merger with Alliance Boots and the company's 26% ownership of AmerisourceBergen (NYSE:ABC).

CVS Health's PBM business has been the primary catalyst for the company's growth in recent years. It's possible that Cigna's planned acquisition of Express Scripts could open up more new business opportunities for CVS Health's PBM. 

While some observers have been skeptical about CVS Health's intended merger with Aetna, there are some reasons why a deal could help the company grow. Perhaps the most intriguing possibility is for the combined entity to provide more bundled services to customers.

Walgreens Boots Alliance's pharmaceutical wholesale business isn't a huge driver of growth for the company. That could change, though, if Walgreens buys the rest of AmerisourceBergen. The Wall Street Journal reported in early February that the companies were in discussions about a potential merger, but those talks apparently ended without an agreement.   

I think that Walgreens probably has the better overall growth prospects, excluding the impact of future acquisitions and mergers by either company. This view is primarily based on Walgreens' aggressiveness in gaining new customers and its growing retail footprint resulting from the Rite Aid deal.

Valuation

At first glance, CVS Health appears to be valued more attractively than Walgreens. CVS Health stock trades at a little over 10 times trailing-12-month earnings and a little less than 10 times expected earnings. Walgreens, on the other hand, claims a trailing-12-month price-to-earnings ratio of nearly 19 and a forward earnings multiple of 10.6.

However, those valuation metrics don't factor in the growth potential for both companies. In my opinion, Walgreens' superior growth prospects give it an edge. 

Dividend

This category appears to be a slam-dunk for CVS Health. The company's dividend currently yields just under 3%, well above Walgreens' dividend yield of 2.33%. In addition, CVS Health uses only 31% of its earnings to fund the dividend program, while Walgreens' payout ratio stands at nearly 43%.

There is a catch, though. CVS Health probably won't increase its dividend like it has in recent years if the Aetna deal goes through. Assuming that CVS Health freezes its dividend at the current level and Walgreens keeps increasing its dividend at the current trend, Walgreens' dividend could catch up to its rival's within a few years.

Of course, it's not certain that CVS Health would freeze its dividend indefinitely. There's also no guarantee that Walgreens will keep increasing its dividend as it has in the past. Therefore, CVS Health's dividend takes the prize.

Better buy

There are things to like about both of these stocks. However, if I had to pick only one, it would be Walgreens Boots Alliance. In my view, it comes down to growth. And while I'm generally positive about CVS Health's planned acquisition of Aetna, I don't like the debt that the company will have to incur to finance the deal.

My personal take, however, is that there are better investment opportunities than either of these stocks. The potential entrance of Amazon into the retail pharmacy business could be disruptive. I don't think Amazon will put either CVS Health or Walgreens out of business, but it could hurt both companies' growth prospects. It's too soon to know how things will shake out, but with the uncertainty, my view is to look elsewhere for now.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Keith Speights has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Amazon. The Motley Fool recommends CVS Health. The Motley Fool has a disclosure policy.