If you're looking for income-generating investments to fuel your retirement dreams, it's hard to go wrong with dividend-paying stocks in the healthcare sector. After all, people need medical care just as often during rough economic times as they do in the good years. 

Recently, Walgreens Boots Alliance (WBA 0.57%) reported results from its fiscal fourth quarter (which ended Aug. 31), and UnitedHealth Group (UNH 0.30%) reported results from the third quarter. Let's weigh their performances to see which stock looks like the better buy right now.

The case for Walgreens Boots Alliance

Walgreens Boots Alliance is a retail pharmacy juggernaut with a presence in nine countries and over $139 billion in annual sales. As such, it's one of the world's largest purchasers of prescription drugs and many health-related items.

Being huge gives Walgreens economies of scale that have supported its steady profit growth in the past. Unfortunately, shifting shopping habits that are keeping folks out of retail pharmacies are taking a toll on its bottom line.

WBA EPS Diluted (TTM) Chart

WBA EPS Diluted (TTM) data by YCharts.

Earnings spiked in late 2021 thanks to a surge related to COVID-19 vaccinations, but they've since collapsed. Walgreens' operations lost a frightening $6.9 billion during its recently ended fiscal 2023 after earning just $1.4 billion in the previous year.

In 2021, it invested $5.2 billion to raise its ownership stake in VillageMD to 63%. That investment was intended to accelerate the opening of 600 primary care clinics co-located in Walgreens' stores, but it isn't working out so well. As of this June, the company had built just 200 co-located VillageMD clinics. And when reporting fiscal fourth-quarter earnings recently, management said it would close 60 of those clinics.

In July 2022, Walgreens announced its 47th consecutive annual dividend raise, and at recent share prices, its payout yields a tempting 8.2%. Before getting too excited about the high yield, you should know that this July, it held its payout steady, and in September, then-CEO Rosalind "Roz" Brewer stepped down.

Incoming CEO Tim Wentworth has more healthcare-related experience than Brewer, which could help the company's primary care investments start to pay off. It's probably best to wait for evidence the company can execute a profitable expansion into primary care before you risk any of your hard-earned money.

The case for UnitedHealth Group

With over 47 million insured members in the U.S., UnitedHealth Group collects more monthly premiums than any other health insurance benefits manager. These days, instead of paying clinicians who run their own practices, UnitedHealth is far more likely to pay one of the estimated 70,000 physicians who work for its health services business, Optum.

Thanks to its ability to provide many of the benefits that it's also paid to manage, profit growth at UnitedHealth has been off the charts. Earnings per share have more than quadrupled over the past decade, and its dividend payout has grown even faster.

UNH Dividend Chart

UNH Dividend data by YCharts.

The stock offers a meager 1.4% dividend yield at recent prices. But the payouts are growing so fast that this stock can probably deliver more dividend income over the next decade than Walgreens can.

The better buy now?

UnitedHealth Group can earn money whether patients visit an Optum-employed doctor in person or online. Unfortunately, we can't say the same for Walgreens.

New, low-cost delivery services from Amazon Pharmacy and Mark Cuban's Cost Plus Drugs will probably make getting customers into physical Walgreens locations increasingly difficult.

Walgreens' economies of scale are unraveling, but the network advantages Optum provides to UnitedHealth Group keep getting stronger. Despite its much lower dividend yield up front, UnitedHealth Group is the better stock to buy right now.