For a stock to be a strong long-term buy, investors need to have confidence that its business will be able to grow indefinitely. COVID-19 stocks that did well during the early stages of the pandemic may have questionable futures heading into next year as concerns around the pandemic subside.

Both Moderna (MRNA -1.39%) and Pfizer (PFE -0.12%) are examples of companies that continue to thrive today due to the pandemic with their highly successful COVID-19 vaccines generating billions in sales for their respective companies. And while both businesses are doing well of late, Pfizer is the one that stands out to me as the better stock for long-term investors. Here's why.

People working in a lab.

Image source: Getty Images.

Pfizer's business is much more diverse

COVID-19 revenue has resulted in surging revenue for Pfizer. In the first three months of 2022, the company generated money from its COVID-19 products (vaccine and pill) of nearly $15 billion, which is more than its entire revenue totaled a year ago during the same period. The company has arguably become too dependent on COVID-19 vaccine revenue.

However, Pfizer does have other segments (outside of vaccines and hospital drugs) that generate billions in quarterly revenue, including oncology and internal medicine. By comparison, all of Moderna's product revenue of $5.9 billion for the period ended March 31 comes from its only commercial product that is authorized for use -- its COVID-19 vaccine, Spikevax.

The obvious counterpoint here is that Moderna is a relatively new kid on the block. Prior to COVID-19, it was a relatively unknown company. But even with planning for the future in a post-COVID world, Pfizer has been much more aggressive in its efforts to diversify.

Pfizer is expanding its business while Moderna stands still

Not only is Pfizer more diverse than Moderna today, that gap is going to widen in the future. That's because while Moderna has been stockpiling cash, Pfizer has been putting some of its excess money to use. This month, the pharmaceutical giant announced it will acquire Biohaven Pharmaceutical Holding (BHVN -4.25%) for $11.6 billion -- all in cash. Biohaven's focus is on developing products that target neurological diseases. It already has multiple approved products, and the company generated $318.9 million in sales in the three-month period ended March 31.

Pfizer has also been involved in other billion-dollar deals. Last year, it acquired Arena Pharmaceuticals, a clinical stage company that is developing therapies for immuno-inflammatory diseases, for $6.7 billion in another all-cash deal. Prior to that, it also paid $2.3 billion for immuno-oncology company Trillium Therapeutics. Pfizer has been making moves to bolster its portfolio and using cash to do so, meaning that investors aren't getting diluted with these acquisitions. In the meantime, Pfizer's pipeline and portfolio of drugs expands, making it a more resilient investment for the future.

Pfizer is generating a ton more free cash

A key factor in being able to fund more deals is having more money coming in. And over the trailing 12 months, Pfizer has been generating much more free cash than Moderna:

Chart showing Pfizer's free cash flow higher than Moderna's since mid-2021.

PFE Free Cash Flow data by YCharts

This can go a long way in funding more acquisitions. It also enables Pfizer to pay a dividend -- something that Moderna doesn't currently do. And at 3.2%, Pfizer's dividend yield is more than double the S&P 500 average of less than 1.4%. 

The no-brainer buy is Pfizer

Overall, Pfizer has a more diverse business than Moderna and it generates more free cash, making it a more stable buy over the long haul. Plus, with a high-yielding dividend to add on top of that, there's also plenty of incentive for investors to just buy and hold this top healthcare stock for years.