CVS Health (CVS -1.07%) doesn't just compete against other pharmacy retailers. For years now, the company has also faced competition from major grocery chains that have launched their own pharmacies, especially Kroger (KR 0.94%). While CVS Health and Kroger battle each other for consumers, the companies also compete for investors' dollars. Which is the better stock for long-term investors? Here's how CVS and Kroger stack up.

Image source: Getty Images

The case for CVS Health

You should think about CVS Health as two different businesses. Most people are more familiar with its retail pharmacies and medical clinics. These pharmacies and clinics are combined with Omnicare long-term care (LTC) pharmacy services to comprise CVS Health's retail/LTC segment. The company also has a pharmacy services segment that provides pharmacy benefits management (PBM) services to employers, health insurance plans, and other payers. 

CVS Health makes more revenue from its pharmacy services segment -- around $88.7 billion in the first nine months of 2016 compared to $60.3 billion for its retail/LTC segment. However, the company actually makes higher profits from its retail/LTC business -- nearly $5.3 billion in operating profits during the same period versus $3.3 billion from its pharmacy services segment.

Both sides of the business are growing and should continue to do so. CVS Health projects long-term average annual earnings-per-share growth of 10%. The company should achieve this growth through a combination of higher sales and stock buybacks. In November 2016, CVS Health's board of directors authorized a share repurchase program of up to $15 billion.

Investors should also benefit from CVS Health's solid dividend. Its dividend yield currently stands at 2.44%. The company increased its 2017 dividend by 17% and has also stated that it plans to continue to increase the dividend payout.

CVS Health appears to be valued attractively. The stock currently trades at 17 times trailing earnings and 14 times forward earnings. That's less expensive than CVS Health has been over most of the past four years.

The case for Kroger

Kroger's business consists of largely of what you see when you visit one of the company's 2,778 supermarkets. However, it also operates 2,231 pharmacies, 784 convenience stores, 323 fine jewelry stores, 1,387 supermarket fuel centers, and 38 food production plants in the United States. 

The biggest chunk of Kroger's revenue stems from its supermarkets, which generated sales of $73.7 billion in the first nine months of 2016. That figure doesn't include fuel sales, which totaled $10.7 billion during the period. Kroger also made nearly $3.3 billion in revenue during the first nine months of 2016 from its other businesses, including its convenience stores and jewelry stores.

Kroger experienced only single-digit percentage revenue growth and a slight drop in earnings during the first nine months of 2016 versus the prior-year period. However, that earnings decrease stemmed from a one-time restructuring of the company's pension accounts. More importantly, Kroger's management expects net earnings per diluted share to increase by 8% to 11% annually over the next several years.

What about Kroger's dividend? Although the company's dividend yield of 1.41% is well below that of CVS Health, Kroger has plenty of room to grow its dividend with a payout ratio of less than 21%. The company announced a 14% dividend hike in June 2016.

Kroger's valuation looks pretty good as well. The stock trades at 16 times trailing earnings and 15 times forward earnings. That's on the low end of Kroger's earnings multiples over the past couple of years and close to the stock's average over the past five years. 

Better buy

Both CVS Health and Kroger are household names that have been around a long time and will likely continue to be around for a long time to come. Both stocks have performed well for shareholders over the last several years, although 2016 wasn't a good year for either CVS or Kroger.

Which stock is the better buy now? My pick is CVS Health. The demographic trends in the U.S. with the aging of the baby boomer generation should boost several of CVS Health's businesses. The stock has fallen due to some account losses last year, but I think CVS is a solid investment over the long run -- especially with its strong and growing dividend.