Investors looking for stocks that can produce impressive gains regardless of the general market's direction should turn their attention to the biopharmaceutical industry. Shares of Vertex Pharmaceuticals (VRTX -0.27%) gained a stunning 33.5% in 2023 while the Nasdaq Composite index that it's a part of sank 33.1% lower.

Of course, one very good year doesn't necessarily mean Vertex Pharmaceuticals can keep climbing in the years to come. To see if it can continue soaring, let's look at reasons the stock's been outperforming the market.

Reasons to buy Vertex Pharmaceuticals

Vertex markets the only disease-modifying treatments for patients with cystic fibrosis (CF). This is a life-shortening disorder that affects around 83,000 people worldwide. Last year, the company reported sales of CF drugs that rose 18% last year to reach $8.9 billion.

All CF patients have sweat and mucous glands that are bad at regulating sodium concentrations, but the disorder can be caused by dozens of different gene mutations. Vertex's lead drug, Trikafta, is capable of treating roughly 90% of the overall CF population.

Last December, Vertex began a clinical trial with CF patients who can't benefit from Trikafta. They'll receive a single dose of VX-522, an experimental treatment the company is developing in collaboration with Moderna. If it succeeds, there are roughly 5,000 underserved CF patients worldwide who could benefit.

Over the past year, Vertex plowed about $3.5 billion into research and development -- and one of its big investments could begin bearing fruit by the end of 2023. Last September, Vertex and its collaboration partner, CRISPR Therapeutics (CRSP -4.14%), told investors they would soon start submitting application packages to regulators in the U.S. and E.U. for exa-cel. This is an experimental gene therapy for the treatment of sickle cell disease and beta-thalassemia.

Reasons to remain cautious

Exa-cel is a once-and-done treatment manufactured in single batches from a patient's own blood cells; in clinical trials it greatly reduced patients' dependence on blood transfusions. But selling this therapy won't be easy. Getting governments and healthcare plan sponsors to invest in one-time treatments has been an uphill battle for other drugmakers.

Vertex has the CF space all to itself now, but it could start losing ground to generic competition within several years. The primary patents that protect ivacaftor in the E.U. expire in 2025, and similar patents in the U.S. expire in 2027. Ivacaftor is a component of Trikafta and the only active ingredient in Kalydeco, the first CF treatment that Vertex launched in 2012.

A buy now?

Additional patents will more than likely extend ivacaftor's market exclusivity into the 2030s, and the company is making progress on a follow-on to ivacaftor called vanzacaftor. This year, Vertex expects to report results from a pair of phase 2 trials with a vanzacaftor-containing candidate.

Success for vanzacaftor could allow Vertex to keep the CF space to itself for another decade or longer. There are no guarantees, but an above-average percentage of Vertex's clinical-stage candidates that reach phase 2 go on to earn approval and generate blockbuster sales.

This is hardly a risk-free stock, but it looks like investors can expect reasonably strong profits from its CF franchise for many years to come. With this in mind, Vertex's future looks a little brighter than its stock price suggests. Shares are currently trading at around 23.1 times last year's earnings. This isn't exactly value pricing, but if you buy the stock now you have a good chance of beating the market over the long run.