The baby boomer generation is fast approaching retirement. Since age and prescription drug usage are correlated, pharmacy companies like CVS Health (CVS 1.49%) and Walgreens Boots Alliance (WBA 3.69%) appear to have the wind at their backs. But which of these two companies is the best choice for investors today? Let's compare these two businesses side by side using a few key metrics to see if we can figure out the answer.

Pills spilled on top of $100 bills

Image source: Getty Images.

Test No. 1: Growth

CVS Health has a number of growth initiatives in place. First and foremost is its pharmacy benefits management business. CVS Health uses its massive size to negotiate volume discounts from drug manufacturers and then passes along the savings to entities that provide health insurance -- think unions, governments, and businesses -- in exchange for a modest fee. Given the rising costs of prescription drugs, this business segment boasts strong renewal rates and cranks out predictable profits.

Up next is CVS Health's retail/long-term care business. While generic drugs introductions and reimbursement headwinds have held back profit growth, over the long term CVS plans to open more MinuteClinics, focus on selling more store-brand products, and make a big push into assisted-living and long-term care facility markets.

When adding these growth opportunities together, Wall Street expects CVS Health to grow its bottom line by more than 8% annually over the long term.

Doctor looking into patient's ear in clinic.

Image source: CVS Health.

Turning to Walgreens, let's first start overseas. Walgreens is a major player in Europe thanks to its buyout of Alliance Boots in 2014. That move made Walgreens one of the largest pharmaceutical wholesalers, retailers, and distributors in Europe. Since demographics also tend to be older in Europe, investors can count on this business showing profits improvements over time.

As for the U.S., Walgreens was counting on its proposed takeover of Rite Aid (RAD 20.00%) to drive growth. However, the Federal Trade Commission put up so many roadblocks that Walgreens eventually caved and settled for buying 2,186 stores plus three distribution centers from Rite Aid for $5.175 billion. While that's not the outcome Walgreens was hoping for, those additional stores still represent a sizable number when compared to Walgreens' current store count of "only" 8,175.

Finally, Walgreens also boasts a pharmacy benefits management business that is doing quite well. Last year, the company wrested two major accounts from CVS Health -- Tricare and Prime Therapeutics -- that added more than 31 million members to its network. 

Add it all up and Wall Street projects that Walgreens will be able to grow its profit in excess of 11% annually over the next five years.

Winner: Walgreens

Test No. 2: Taking care of shareholders

CVS Health and Walgreens are both mature businesses that have cranked out excess profits for decades. For that reason, they both boast a long history of rewarding shareholders with buybacks and dividends.

Let's start with buybacks. Over the last 10 years, both companies have spent billions on share repurchases. However, Walgreens has also been issuing stock as a method to pay for its many acquisitions. Here's a look at the share count of these two companies over the last decade.

WBA Average Diluted Shares Outstanding (Quarterly) Chart

WBA Average Diluted Shares Outstanding (Quarterly). Data by YCharts.

CVS Health has managed to shrink its share count by more than 30%. Meanwhile, Walgreens' share count has actually increased over the same time period.

Turning to the dividend, here's how these two companies currently stack up:

 Company Yield Payout Ratio 5-Year Dividend Growth
CVS Health 2.5% 37% 122%
Walgreens Boots Alliance 2.1% 37% 45%

Data source: Yahoo! finance, YCharts.

While both companies clearly care deeply about returning capital to shareholders, I think that CVS Health deserves the edge here since its share count has drifted lower over time and it boasts a higher dividend growth rate.

Winner: CVS Health

Test No. 3: Value

No discussion of investing potential would be complete without a look at valuation. Here's how these two companies compare when using a variety of metrics.

 Company P/S Ratio Trailing P/E Ratio Forward P/E Ratio P/FCF Ratio
CVS Health 0.42 14.8 11.7 8.2
Walgreens Boots Alliance 0.64 17.6 12.8 11.6

Table source: Yahoo! finance. Y-charts. 

Almost across the board, you can see that the market is assigning a higher price tag to Walgreens' business. That premium makes sense when you consider its higher growth rate. However, in terms of valuation, there's no doubt that CVS Health is the cheaper option today.

Winner: CVS Health

The Foolish bottom line

While neither of these businesses is a sure bet over the long term -- the recent news that Amazon.com is looking at the pharmacy space should give investors pause -- my personal view is that both Walgreens and CVS Health have enough going for them to justify an investment today. However, if forced to choose, I must admit that CVS Health's lower valuation and higher dividend yield make it my favorite for new money today.