There's more than one way to assess whether one stock is a better bargain than another. 

The forward price-to-earnings (P/E) ratio is a good gauge of whether a stock is a bargain, but when a stock's growth prospects are rapidly growing or declining, the metric can be misleading. Price-to-book (P/B) values can be useful in finding companies with solid returns that are overlooked, but comparing two companies by their P/B values doesn't work well if the companies don't have similar growth and profitability.

One more metric that's useful for comparisons is looking at a company's return on equity (ROE) and whether it is rising, because it shows how profitable a company is likely to be. This last measure is why I think CVS Health (CVS -0.22%) is a better buy than its lead pharmacy competitor, Walgreens Boots Alliance (WBA 0.57%). Walgreens' forward P/E and P/B are only slightly lower than CVS Health's, but CVS Health's ROE is much better than Walgreens' ROE.

Charts showing CVS's PE ratio, PB ratio, and return on equity beating Walgreens' in 2023.

CVS PE Ratio (Forward) data by YCharts

Both healthcare companies have expanded beyond being pharmacies. CVS has the largest pharmacy benefits management business in the U.S., and since 2018 it has owned health insurer Aetna. Walgreens is pushing for more primary care clinics in its stores. Both healthcare companies have seen their shares plummet so far this year, with Walgreens falling by more than 22% and CVS dropping over 25%.

Diversification is helping CVS grow revenue

CVS reported first-quarter numbers on May 3. The company reported revenue of $85.3 billion, up 11% year over year. Earnings per share (EPS) came in at $1.65, down from $1.77 in the same period a year ago, due in part to recent acquisitions.

Retail sales have slowed for many pharmacies because foot traffic is down, thanks to a decreased need for COVID-19 shots, tests, and remedies. CVS's pharmacy and consumer wellness segment was its slowest-growing. Revenue rose 7.8% in the first quarter, year over year, but its other two segments, healthcare benefits and health services, saw revenue climb 12.1% and 12.6%, respectively.

Walgreens, on the other hand, reported slower revenue growth in the third quarter of fiscal 2023. It had revenue of $35.4 billion, up 8.6% year over year, with EPS falling to $0.14, compared to $0.20 in the same period a year ago. Through nine months, the company reported a net loss of $2.9 billion compared to net earnings of $4.8 billion in the first nine months of fiscal 2022.

Walgreens' hefty dividend may not last

Walgreens raised its quarterly dividend last July by 0.05% to $0.48, the 47th consecutive year it has increased its dividend. The yield is around 6.6%, which is more than four times the S&P 500 average of 1.66% and nearly double the dividend yield of around 3.48% that CVS offers. 

Walgreens could boost the dividend later this month, like it did last year, but there's a catch. The company's payout ratio is off the charts at 400%. In other words, Walgreens paid out four times what it delivered in EPS this past quarter. That's obviously not sustainable in the long run.

Walgreens could continue to increase its dividend, even if only by a small amount like it did last year. The company only has three years to go to become a prestigious Dividend King, a select group of companies that have boosted their dividends for at least 50 consecutive years. However, if Walgreens cuts its dividend, or doesn't raise it, many investors who hold on to the stock mainly for that juicy dividend would hit the exits and the stock would really plummet.

CVS increased its quarterly dividend by 10% last year to $0.605, but it's only the second consecutive year it has increased the dividend after freezing it at $0.50 from 2019 to 2022. The company's payout ratio is a much more sustainable 36%, however, so there's a likely chance that CVS will continue to increase it. That's especially true since the company increased free cash flow to $7.4 billion in the first quarter, up 109% year over year.

CVS is more bullish on its future

CVS reported revenue of $322.5 billion in 2022, up 10.4%. This year, it said it expects that to rise to between $348 billion and $353 billion. The company has seen revenue rise for 12 consecutive years.

Walgreens, on the other hand, recently revised its full-year guidance downward. It now says it expects 2023 adjusted EPS to be between $4.00 and $4.05, down from earlier forecasts of between $4.45 and $4.65, and well down from the $5.04 in adjusted EPS it reported in fiscal 2022.

Walgreens has said it plans to slash costs, and it has raised nearly $1 billion to pay down its debt by selling shares of Option Care Health and AmerisourceBergen this year. However, I don't think the company can create a turnaround simply by cutting costs.

CVS seems less like a company in decline, and it continues to expand with its acquisition of Signify Health and Oak Street Health this past spring to improve its value-based care options.