The U.S. economy is coming off an abysmal second quarter that saw GDP contract by 32.9%. This decline was no surprise given the widespread problems the COVID-19 pandemic is causing for businesses. Many companies are either cutting back on their forecasts for the year or are simply no longer making projections of how they'll do given the uncertainty ahead. But not all companies are worried.

The three companies listed below are optimistic about the future and recently increased their projections for the year. Doing well during the pandemic's no easy feat, and that makes these companies attractive investments to add to your portfolio today.

1. Merck

In Merck & Co.'s (MRK 0.44%) second-quarter results, released July 31, worldwide sales were down 8% year over year, largely because the COVID-19 pandemic has led patients to make fewer visits to doctors' offices. That said, revenue from its cancer-fighting drug Keytruda rose by 29%. The New Jersey-based company's results were good enough to beat analyst expectations for Q2, as adjusted earnings per share (EPS) of $1.37 were well above Wall Street estimates of $1.04. Revenue of $10.9 billion was also better than analyst forecasts of $10.4 billion.

Hand drawing bar chart showing numbers getting higher.

Image source: Getty Images.

The drugmaker's also optimistic that things will slowly get back to normal for its business by the fourth quarter. As a result, it's boosted its projections for the year. Previously, Merck was expecting adjusted EPS to fall within a range of $5.17 to $5.37. It now expects those numbers to be between $5.63 and $5.78.

Merck's numbers could continue to get stronger if it develops a successful vaccine for COVID-19. In May, it announced it was buying Austrian vaccine company Themis Bioscience and that Merck would now be working on developing two separate vaccines. The company expects to begin human trials sometime later this year. 

2. eBay

eBay (EBAY 0.88%) is coming off a strong quarter, and management doesn't expect things to slow down just yet. In the online marketplace and auction site's second-quarter results July 28, net revenue of $2.9 billion was up 18% year over year. Its net income of $746 million was also up 86% from the prior-year period.

The California-based company forecasts net revenue of between $10.6 billion and $10.8 billion. That's up from its projections in the first quarter, where eBay anticipated net revenue to come in no higher than $9.8 billion.

The company's also expecting its bottom line to be stronger, projecting diluted EPS from continuing operations to be between $2.85 and $3.00. Previously, eBay was forecasting those figures to fall between $2.20 and $2.30.

A key reason for the optimism is that amid the COVID-19 pandemic, many users have been shifting from in-store shopping to buying goods online. Management has noted not just additional traffic but excellent performance across several product categories and key metrics.

3. Scotts Miracle-Gro

Scotts Miracle-Gro's (SMG -1.80%) third-quarter results, released July 29, were so good that the company didn't just raise guidance -- it also announced a special dividend and boosted its regular payouts. 

Sales were up 28% in Q3, and its Hawthorne subsidiary, which serves cannabis growers, grew at a rate of 72%. It's not a big surprise for Hawthorne to be doing so well, given that cannabis sales are particularly strong amid the pandemic with multiple states reporting record numbers this year.

The company, based in Ohio, announced it would be paying its shareholders a special dividend of $5 per share and that its regular dividend payments would be increasing by 7%. The dividend now yields about 1.6% per year -- slightly less than the 2% investors can expect with the average S&P 500 stock. Merck pays 3% per year, while eBay's yield is currently sitting at 1.1%.

Management at Scotts Miracle-Gro now projects that companywide sales growth for the full year will be between 26% and 28%. That's a massive increase from the 6% to 8% it was expecting back in Q2. 

It also upgraded its earnings numbers, and the company now expects adjusted EPS to be within a range of $6.65 to $6.85 for the full year. Estimates in Q2 were for a range of $4.95 to $5.15.

Which stock is the best buy today?

All three stocks are doing well during the pandemic. Here's how they're doing thus far in 2020 against the S&P 500:

MRK Chart

MRK data by YCharts

Both Scotts and eBay are significantly outperforming the market in 2020.

Merck's a bit of an underdog here, and that's why the stock would get the edge from me today. It's not getting much hype from its vaccine efforts, but that can change in a hurry as more news comes out about its progress. And if the worst is truly behind the healthcare stock, now may be a great time to buy it.