Retailers in early June are just starting to reopen their doors after a pause in selling activity that lasted almost two months. While a global virus pandemic and related containment measures are (hopefully) once-in-a-lifetime events, the situation has helped investors separate merely good stocks from the type of business that can thrive through unprecedented economic and selling pressures.

With that in mind, let's look at three companies that sailed through the initial phases of the pandemic and look as attractive as ever heading into the second half of 2020.

A woman shops while wearing a mask.

Image source: Getty Images.

1. Procter & Gamble

Procter & Gamble's (NYSE:PG) business was looking good even before COVID-19 placed a global premium on consumer staple products like home cleaning supplies. Sales growth accelerated through 2019, leading to a rare back-to-back outlook upgrade by P&G's management team.

The early phase of the pandemic accelerated those gains as organic sales growth hit a blistering 10% in the fiscal third quarter, which runs through the end of March. Some parts of P&G's portfolio, like beauty products and shaving care, were weak, but overall, the company demonstrated just how entrenched brands like Bounty, Tide, and Crest are with consumers around the world. Executives credited the "integral role our products play in meeting the daily healthy, hygiene, and cleaning needs of consumers" for supporting $12.6 billion of operating cash flow over the last nine months, compared to $11.1 billion in the year-ago period.

It is too early to tell whether management is right in predicting that demand will stay elevated for many of these staple products. But investors who buy this stock know they're getting an unusually recession-resistant business that has raised its dividend in each of the past 64 years.

2. Dollar General

Retail investors face an unusually long list of risks to the industry ahead, including more potential localized virus outbreak scares and sluggish economic growth. So why not buy a stock that can withstand such difficult selling environments, if they come?

Dollar General (NYSE:DG) in late May proved that it is a significant consumer destination for essential products. Its sales growth rate was more than double Walmart's 10% spike in the first quarter. And, unlike its larger rival, the value-focused retailer is enjoying increasing profitability as gross profit margin rose and selling expenses fell as a percentage of sales.

The company isn't issuing an outlook for the rest of 2020, but comparable-store sales were up by over 20% through early May, executives said. Dollar General's 30-year streak of positive results on that core metric, meanwhile, show that it has the right assets for the type of consistent growth that delivers impressive returns to investors.

3. Costco

When customer traffic soared in early March, investors got an early sign that Costco (NASDAQ:COST) would be a big beneficiary of stock-up behavior by consumers. Those gains mostly carried through the entire social distancing lockdown, too, although the retailer's 8% sales increase significantly trailed regional rival BJ's Wholesale (NYSE:BJ).

A woman shopping for meat.

Image source: Getty Images.

But Costco has two assets that make it a better investment today. The warehouse giant boasts a longer growth track record, with comps rising 8% in the last complete fiscal year compared to BJ's 1% uptick.

Costco also has a highly loyal shopper base. Its renewal rate edged up to 91% in the quarter that ended on May 10, compared to BJ's 87%. That industry-leading renewal rate confirms that members are getting plenty of value out of their subscriptions. It's also the best single predictor of long-term sales growth.

It will be at least another quarter before investors find out how the pandemic impacted Costco's renewal rate, either in a positive or negative way. But its rebounding sales trends in May suggest there could be more good news on this score for investors seeking businesses that can thrive through even the worst selling environments.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.