The pandemic isn't over, but there has been tremendous progress in the fight against it. And now, investors are abandoning many of those companies that made contributions to helping curb the spread of the disease.

While it is true that some of those corporations might now have concerning prospects, others still look like excellent long-term investments. Two examples are Pfizer (PFE -3.85%) and Moderna (MRNA -2.45%). Let's see why.

1. Pfizer

Pfizer has been one of the most successful companies in the coronavirus vaccine market with Comirnaty. It also owns a successful therapy for the disease, Paxlovid. These two products have helped revenue soar in the past couple of years. But investors believe that demand for coronavirus vaccines and medicines will drop substantially starting next year.

And the rest of Pfizer's lineup isn't doing so well, given that some of its key products have encountered headwinds. Sales of immunosuppressant Xeljanz are declining due to regulatory obstacles, and cancer medicine Ibrance has also seen its revenue drop, partly due to price decreases. But the company isn't in as bad a spot as it seems. Pfizer has beefed up its pipeline recently, partly thanks to acquisitions.

And with several promising programs on the way, the company should earn several major approvals in the next couple of years. Pfizer recently sent an application to the Food and Drug Administration (FDA) for a potential vaccine for the respiratory syncytial virus (RSV). The agency accepted Pfizer's application, granting it priority review, a designation reserved for medicines or vaccines that would improve current standards of care if approved. The review period is shortened to six months instead of 10.

There are currently no FDA-approved vaccines for RSV, so Pfizer could be on the verge of earning the first one. Earlier this year, Pfizer submitted an application to health authorities in the U.S. and Europe for a potential treatment for alopecia, a form of hair loss.

These and other new products should help improve Pfizer's lineup, which still features top-performing products such as blood thinner Eliquis and the company's Prevnar vaccines, which help protect against pneumonia. And revenue from Paxlovid and Comirnaty won't drop to zero. We have seen waves of COVID-19 cases come and go.

Patients at high risk of severe disease will continue to get boosted regularly, and many others will still need therapies against the illness. Overall, Pfizer's lineup should be able to return to top-line growth once challenging comparisons with the peak pandemic years fade into the rearview mirror. In the long run, the healthcare company can still deliver solid financial results and stock market performance. 

2. Moderna 

In some ways, Moderna is in the same boat as Pfizer. The biotech company markets a successful COVID vaccine, but that tailwind seems to be about to slow considerably. Unlike Pfizer, Moderna does not have a long list of approved products. Still, investors shouldn't give up on the company as its mRNA approach to developing vaccines can potentially yield solid results in the next half-decade.

Moderna should also continue to generate some sales from its coronavirus vaccine beyond this year as people still seek booster shots, allowing it to push promising programs through the pipeline. The company is working on a potential influenza vaccine, mRNA-1010, which is undergoing a phase 3 study. Moderna plans to release data from this trial in the first quarter of 2023.

Although there are flu vaccines on the market, they are typically not very effective. For instance, for the 2021-2022 campaign, seasonal flu vaccines were about 35% effective in the U.S. This often happens because flu vaccines don't match the virus strains that are in circulation since manufacturers have to put these products together months before the flu season starts. 

Moderna seeks to solve this problem with its mRNA candidates, which are faster to manufacture. This allows it to get much closer to the start of the flu season -- when we have better estimates of which strains will be in circulation -- before it starts manufacturing the vaccines.

The biotech has several other candidates in its late-stage pipeline, including a potential RSV vaccine and another targeting the cytomegalovirus, for which there are no vaccines at the moment. Moderna anticipates a data readout for its ongoing phase 3 study for its RSV vaccine in the winter.

Moderna has many other candidates in phase 2 and phase 1 trials. While the company could suffer again in 2023 as the pandemic hopefully continues to fade, Moderna's long-term prospects are solid thanks to its deep pipeline and the money it generates through the sale of its COVID vaccine. In short, this biotech is still worth buying and holding as it goes through a rough patch.