The COVID-19 pandemic has had a huge impact on the health and well-being of millions of people. Yet at a time when many transportation, entertainment, vehicle rental, and airline stocks are getting hammered, Peloton Interactive (NASDAQ:PTON), Wayfair (NYSE:W), and B&G Foods (NYSE:BGS) are not only surviving the COVID-19 pandemic, they are thriving.

^SPX Chart

^SPX data by YCharts.

One door closes but another opens

Roughly two months ago, when gyms across the nation were closing their doors, savvy investors knew a door had opened for Peloton's business. Peloton, the largest interactive fitness platform in the world, is trying to become a household name, and it's made substantial progress during COVID-19 as consumers have looked for ways to exercise from home.

When Peloton reported its fiscal third-quarter earnings on May 6, 2020, it noted a 94% increase in connected fitness subscribers to more than 886,100. Hardly a week later, management announced the number had soared beyond its impressive third-quarter level to top 1 million. Here's what's even more impressive: The 1 million-subscriber milestone was only part of the recent boost in business.

Another bright spot can be found with the company's user engagement. Fitness subscribers averaged 17.7 monthly workouts during the third quarter, up from the prior year's 13.9 workouts, and Peloton's average net monthly connected fitness churn was 0.46%, the lowest level in four years. Simply put, more people are joining Peloton, and those who join are using its services more.

Woman using stationary bike.

Image source: Getty Images.

The devastating COVID-19 pandemic has slammed much of the economy, but it has also opened the door for Peloton to become more of a household name, and the company is currently seizing that opportunity. The one knock on Peloton currently is that its stock is trading at rich valuations.

As well as Peloton has performed over the past three months, the next two entries on our list have performed as well or even better.

This is the way

There's been a clear trend that companies with well-developed e-commerce capabilities are doing better than the competition during COVID-19. And even among companies with strong e-commerce prowess, Wayfair has still shined brighter, with its stock up 100% over the past three months. If you haven't heard of the company, Wayfair enables consumers to shop online for more than 18 million items across home furnishings, decoration, home improvement, housewares, and more.

While many Americans have grown cautious about spending on big-ticket items, such as a new vehicle, many have also opted to redesign a room or redecorate and have increasingly shopped for products online during COVID-19 -- all great news for Wayfair. In fact, Wayfair's co-founder and CEO, Niraj Shah, noted the company was seeing strong acceleration in new and repeat customer orders across almost all classes of goods in all regions. Another driving force behind the company's rising stock price is that management is also improving gross margins, increasing marketing efficiencies, and increasing its scale to better control operating expenses.

Wayfair is uniquely positioned as a growing e-commerce platform with a strong logistics network to deliver products faster and better than most competitors, and that's partly why it has thrived during COVID-19. The question now is whether Wayfair can use this boost in business to drive brand image and pricing power in a competitive online retail area in which consumer switching costs are nonexistent and creating a cost advantage is difficult.

Eat this, not that

While the tragic COVID-19 pandemic has turned the dine-in restaurant industry upside down, B&G Foods has been a large beneficiary of changing consumer eating habits. As stay-at-home orders across the nation have forced consumers into new routines for work, play, and eating, B&G Foods has recorded a significant increase in consumption of its products beginning in mid-March and extending into the second quarter. The change in consumption, as many consumers are now cooking and eating at home more than at any other time in recent memory, drove a better-than-expected first quarter compared to analysts' estimates.

Breaking it down further: B&G Foods has recorded increasing net sales to supermarkets, mass merchants, warehouse clubs, wholesalers, and e-commerce customers to more than offset declines in food-service customers. B&G Foods' net sales in April 2020 increased more than a staggering 60% compared to the prior year. The increased sales, as consumers stocked pantries and avoided dine-in restaurants, were easy to see coming; what's less certain is how those numbers will look once COVID-19 is under control. Will eating at home become more of a permanent habit, or will people jump to the other end of the spectrum and splurge by eating out more than they did before the pandemic?

Finding a way through a crisis

COVID-19 and its dreadful impacts across the nation have been a reminder that when a door closes for one company, there's almost certainly a door opening for another company. These three stocks serve as great examples of how businesses can find ways to serve customers even under the most difficult of circumstances. Now management's focus will be how to turn this temporary boost in business into a long-term advantage.