No pair of companies dominated the COVID-19 vaccine market quite like Pfizer (PFE 0.71%) and Moderna (MRNA 3.25%). Both saw their revenue and earnings skyrocket, along with their share prices, as governments rushed to buy millions of doses of their respective vaccines. However, this tailwind came to a screeching halt as the pandemic receded, and the market reacted accordingly.

Pfizer and Moderna have been trailing broader equities for the better part of two years. Still, there remain good reasons to invest in these stocks, at least for investors focused on the long term. Let's find out more.

1. Pfizer

Investors became disenchanted with Pfizer because, beyond its declining coronavirus-related sales, the rest of the company's lineup didn't seem capable of driving solid top-line growth. Pfizer shares have fallen 30% over the past year.

However, the drugmaker has made tremendous clinical and regulatory progress over the past year. Pfizer has been on a roll, earning important approvals and rejuvenating its portfolio of medicines, which should help it get back to growth once the effects of its COVID-19 products wane.

Last year, Pfizer got regulatory approval for seven brand-new products. They include Litfulo, a treatment for alopecia areata (an autoimmune disease) for patients as young as 12 -- the first such therapy in the U.S. to be approved for patients that young. Pfizer also launched one of the world's first vaccines for the respiratory syncytial virus (RSV), Abrysvo.

Though these products will take some time to ramp up their sales, they should eventually contribute meaningfully to Pfizer's growth. The pharmaceutical giant also beefed up its pipeline, most notably with the acquisition of the cancer-focused biotech Seagen for $43 billion. Pfizer could afford to splurge on buyouts partly due to the significant windfall from its success in the coronavirus market. Pfizer has 112 programs in its pipeline, including 31 in phase 3 studies.

The drugmaker can handle a year or two of declining revenue and come out on the other side just fine. So, long-term investors shouldn't give up on the stock. Pfizer is also a solid option for income seekers. It currently offers a yield of 6.05% and has raised its payouts by almost 17% in the past five years. Pfizer's cash payout ratio is at 193%, which suggests its dividend program is unsustainable. That's likely due to recent acquisitions, but the company has no plans to slash its payouts.

As management recently said: "Our expectation is to maintain and grow our dividend while de-levering our capital structure." Investors have little to worry about on this front, in my view, given Pfizer's broadening pipeline and ability to generate solid earnings and cash flow.

2. Moderna

Moderna did not have a vast portfolio of products to fall back on once its coronavirus-related sales dropped off a cliff. And investors have become disenchanted, sending the stock lower by 27% over the past 12 months.

However, the biotech is moving in the right direction. First, Moderna gained some market share in the COVID-19 vaccine space. Though it will never generate the kinds of sales it once did in this niche, COVID-19 isn't going away. Some people, particularly those at significant risk of severe cases of the disease, continue to get inoculated.

Notably, Moderna needs this market far more than Pfizer does. Recently, the vaccine maker reported positive interim phase 3 results for a next-gen COVID-19 vaccine. Moderna has also made moves in other areas. The company could join the new RSV vaccine market this year after sending applications for its candidate to various regulatory bodies in 2023.

The biotech is running several phase 3 studies for other promising candidates, too. Moderna is testing a combination COVID/flu vaccine in late-stage trials and another for the cytomegalovirus. Moderna expects data readouts for both later this year. Its late-stage pipeline also includes a potential cancer vaccine. And it is close to starting late-stage trials for several other products, including an investigational Epstein-Barr virus vaccine.

Moderna's lineup should be transformed within the next couple of years. Investors who hold on to its shares until then (and beyond) should be handsomely rewarded.