Not many companies have displayed coronavirus immunity. The pandemic temporarily shut down stores, delayed manufacturing, and kept workers home. As a result, the earnings and share prices of companies from retail to healthcare have suffered.

Still, there have been a few companies that managed to fare well during these trying times. I'm thinking of retail giant Amazon (AMZN -1.65%), streaming service Netflix (NFLX 1.74%), and biotech company Vertex Pharmaceuticals (VRTX -0.76%). Their shares have climbed 63%, 48%, and 27%, respectively, this year. Here's why they each performed well during the early stages of the coronavirus pandemic and should continue to be safe havens as the health crisis continues.

A researcher's gloved hands hold a handful of $100 bills.

Image source: Getty Images.

1. Amazon

As lockdowns started, many shops closed and consumers stayed home. The nature of Amazon's business -- online retail of groceries and general merchandise -- makes it an obvious winner during this sort of situation, you might say.

Not necessarily. Though Amazon saw a surge in demand while demand disappeared for other retailers, Amazon's management of the situation was key to its success. In the early days of the crisis, Amazon struggled to keep up with orders. Certain products became unavailable, and shoppers had to wait days for deliveries. Fortunately, that didn't last long. Amazon quickly ramped up operations, hiring 175,000 workers in fulfillment and delivery.

That bet has started to pay off. The company reported a 26% increase in sales to more than $75 billion for the first quarter. Amazon Web Services (AWS), the company's cloud computing business, also benefited from coronavirus-related business. For instance, the World Health Organization used AWS to collect epidemiological data from countries, and the U.K.'s National Health Service used AWS to examine hospital occupancy information in England. Amazon hasn't released recent data on subscriptions to its Prime membership program, but as consumers have favored online buying this year, the Prime program has probably exhibited strong growth.

Amazon will report its second-quarter earnings on July 30. The company predicted that it will spend all of the $4 billion-plus operating profit it would normally generate in the quarter on coronavirus-related measures concerning employee safety and reliable order fulfillment. These costs don't worry me. The more Amazon shows responsibility toward employees and customers now, the better business will be in the future.

2. Netflix

With orders to stay home, what have so many people around the world done? They've signed up for Netflix. The streaming service said paid memberships jumped 22.8% year over year by the end of the first quarter and 27.3% as of the end of the second quarter. That totals 26 million new subscribers for the first half compared to 12 million in the year-earlier period. In the second quarter, net revenue climbed 25% year over year and operating income surpassed $1 billion.

That said, Netflix started its recent earnings statement with a call for caution. The company said a lot of the subscriber signups it would have seen in the second half of the year came early due to the health crisis. For that reason, Netflix expects slower subscriber growth in the second half of the year. The company forecast net additions of 2.5 million paid subscribers for the third quarter. In the third quarter of last year, Netflix added 6.77 million paid subscribers.

The slowdown in subscriber growth is logical and doesn't change my long-term optimism. Netflix subscriber numbers have been marching higher year after year, in many cases driven by the company's original content. As productions of its shows resume, new content will eventually be on the menu. That's likely to drive subscriptions higher in the long term.

3. Vertex

Many companies have withdrawn guidance due to the unknown duration of the coronavirus pandemic. Not Vertex. As a matter of fact, the health crisis didn't interrupt the supply chain of its medicines, and Vertex even increased its full-year guidance for product revenue.

Vertex is a leader in the cystic fibrosis market, selling four treatments for the illness. Among those treatments is Trikafta, approved in October. Trikafta is approved for patients age 12 and older who have the most common cystic fibrosis-causing gene mutation. The medicine has the potential to treat 90% of cystic fibrosis patients in the future, Vertex said. In its first full quarter on the market, Trikafta already generated $895 million in sales. Morningstar predicts Vertex's entire cystic fibrosis portfolio may contribute more than $10 billion to revenue by 2028 -- that's up from $3 billion two years ago. Further down the road, Vertex also has revenue potential in the treatment of pain and blood disorders. Those projects are currently in clinical trials.

Management of its supply chain during the crisis and Vertex's position in the cystic fibrosis market are two clear reasons why this biotech stock remained immune to the coronavirus crisis. That makes me confident about its ability to continue navigating the next stages of the coronavirus pandemic.