Some investors intend to hold shares of the companies they own for good, never having to sell them. This strategy makes sense. Warren Buffett, the man widely regarded as the greatest contemporary investor, is famous for saying that his favorite interesting period is "forever."

However, it isn't always easy to find corporations with the potential to deliver excellent returns for a lifetime. To do so, turning to the healthcare industry is a good idea -- since medical care is, and will always be, in demand. So let's look at two healthcare stocks that can help set investors up for good: Vertex Pharmaceuticals (VRTX -0.06%) and HCA Healthcare (HCA -2.37%).

1. Vertex Pharmaceuticals

Vertex Pharmaceuticals has an excellent track record. In the past 10 years, it has emerged as a top biotech with a laser focus on treating one rare disease of the lungs: cystic fibrosis (CF). Although no other companies compete with the drugmaker in this narrow field, Vertex thought it wise to diversify its pipeline to launch therapies in other areas.

It just accomplished this goal with Casgevy, a gene-editing treatment for two rare blood disorders: transfusion-dependent beta-thalassemia (TDT) and sickle cell disease (SCD). Casgevy, which Vertex developed with CRISPR Therapeutics, just earned the green light in the U.K.; the evidence suggests that more regulatory approvals in the U.S. are forthcoming. Once again, this shows Vertex's innovative prowess.

While it continues to develop improved CF medicines, Vertex also boasts several exciting candidates outside of its core CF area. One of its promising early-stage products is VX-880, a potential functional cure for type 1 diabetes. That may sound like a long shot -- but so did curing TDT and SCD 10 years ago. Vertex's dominance in CF has led to excellent financial results for the past decade:

VRTX Revenue (Quarterly) Chart

VRTX Revenue (Quarterly) data by YCharts.

The company still has some progress to make in this field, but with the addition of Casgevy, revenue and earnings growth should strengthen even further. And down the line, once it expands its portfolio of approved therapies even more, things should be even better for Vertex and its shareholders. So while the company has consistently delivered market-beating returns in recent memory, it's not too late to invest in the stock -- far from it. Vertex has the tools to do the same for a long time.

2. HCA Healthcare

HCA Healthcare is a leading hospital chain in the U.S., one of the largest of its kind. Though the healthcare industry is constantly changing, it's hard to imagine a near future in which the need for medical facilities completely subsides. In fact, the opposite might happen as the world's population ages. That puts HCA in a position to remain relevant and even thrive for a long time, provided it can execute.

On that front, the company's track record speaks volumes. Between 2011 and the second quarter of 2022, HCA increased its market share from 23% to 28%.

Here's something else that works in its favor. While building a network of medical facilities is highly capital-intensive, that's just the first step. Creating working relationships with physicians and third-party payers, including government ones, is also time-consuming. HCA Healthcare has already jumped through all these hoops, which grants it a significant advantage.

It is true that over the past three years, HCA's results haven't been consistent. That's because of the pandemic's disruptions to its business, including occupancy levels in its facilities, a key ingredient of the company's revenue. Furthermore, economic challenges, especially labor-related ones (HCA had to rely on more expensive part-time and contract labor during much of the pandemic), played a role in increasing its expenses and squeezing the bottom line. Still, those are relatively temporary issues that are beyond its control.

At any rate, once we zoom out, the company's financial results look solid:

HCA Revenue (Quarterly) Chart

HCA Revenue (Quarterly) data by YCharts.

HCA Healthcare has a solid position in an industry that will always be in high demand, and a habit of increasing its market share. Those are top reasons why it can help set investors up for life.