Two of the top healthcare companies you can invest in today are CVS Health (CVS 1.49%) and Walgreens Boots Alliance (WBA 3.69%). Both are pharmacy retailers that have been expanding their horizons in recent years beyond just their core operations. And both also pay above-average yields.

Are you better off going with Walgreens' more focused approach or that of CVS, with its broader, more diverse business model? Let's look at both.

Pharmacist handing prescription medication to a customer.

Image source: Getty Images.

The case for Walgreens

One of the most attractive features about Walgreens, particularly for income investors, is its high yield, which at 4% far exceeds the 2% payout that CVS offers and the S&P 500 average's 1.3% yield. Plus, Walgreens has also been increasing its dividend payments for 46 years in a row with the latest hike, announced in July 2021, representing a 2% bump up in the payout. (CVS only recently began increasing its dividend payments again.)

But Walgreens also offers more than just a good payout. The company has partnered with primary care provider VillageMD to provide its customers with more comprehensive healthcare solutions, meaning they can shop at their local Walgreens while also being able to see a physician nearby. Last year, the healthcare company announced a $5.2 billion investment in VillageMD, including plans to open at least 600 primary care practices at Walgreens locations by 2025. It claims to be "the first national pharmacy chain to offer full-service primary care practices with primary care physicians and pharmacists co-located at its stores all under one roof at a large scale."

That investment could go a long way in helping to diversify the company's operations and potentially strengthen its bottom line. The company has already seen how simply driving more traffic to its stores can result in a big payoff for its business. Walgreens is coming off a strong first quarter for fiscal 2022, where its U.S. retail comparable-store sales were up 10.6% for the period ended Nov. 30, 2021, as COVID-19 vaccinations and testing helped generate more in-store traffic.

By looking beyond the pandemic and focusing on being a place where customers can also receive primary care, Walgreens can ensure there are still plenty of reasons for people to continue coming to its stores.

The case for CVS Health

CVS Health is the larger of the two companies and is already more diversified today. Helped by Aetna -- the large health insurer it acquired in 2018 -- the company's focus is much broader than Walgreens.

In 2021, the company's revenue totaled $292.1 billion, up 8.7% from the previous year. (By contrast, Walgreens reported $134.9 billion in revenue over its trailing 12 months.) Sales of products are still the bulk of its business, at $203.7 billion. But CVS also generated $76.1 billion in revenue from insurance premiums, which rose by 10% from a year ago. The rest of its top line comes from services and investment income.

Although the company's net income of $7.9 billion was just 2.7% of revenue, CVS has consistently reported profits. And over the years, it has reported a higher operating margin than its rival, as seen in the chart.

CVS Operating Margin (TTM) Chart

CVS Operating Margin (TTM) data by YCharts

Although CVS isn't offering full primary care at its pharmacies like Walgreens is planning to, the company is still transforming many of its locations into HealthHUBs, which provide an array of services. Customers can get treated for common illnesses (such as strep throat or ear infections) and have professionals help them manage chronic conditions like diabetes through screenings, counseling, and treatment. In 2019, it announced plans to have 1,500 of those locations up and running by the end of this past year.

So which stock should you go with?

Although CVS is more diverse and slightly more profitable, the difference isn't significant; Walgreens looks to be the better investment all around. Its dividend pays more, and the company is investing in primary care, which should help lead to even more traffic at its stores.

While diversification can be great, in some cases it can complicate things and give a company too many areas to focus on -- like CVS' recent trademark filing that covers digital products and services, which suggests it's looking at getting into the metaverse. Walgreens is also the cheaper of the two stocks right now, trading at a forward price-to-earnings multiple of just over 9 while CVS trades at 13 times its future profits.