Even in the midst of a pandemic and the upheaval of entire industries, the market has rallied all the way back to where it started 2020. It may seem like stocks are completely disconnected from reality, and in fact some may very well be. But on average, it's a wash with some struggling companies getting offset by those doing very well -- some in spite of COVID-19 and others because of it.

Three large-cap stocks that have helped the market rally in recent months are Facebook (META 2.10%), Comcast (CMCSA 0.24%), and Mastercard (MA -2.02%). And fresh off of second-quarter earnings, all three look like buys to me.

What struggling ad business?

There was all sorts of worry about advertising revenue as the pandemic got rolling, and Facebook in particular, with its reliance on small business spending, was a focal point. In a recession, a combination of lower advertising effectiveness and businesses tightening up their budgets isn't great news for a company that relies on ads. 

From a financial standpoint, the company laid those worries to rest with its second quarter report, posting all-out growth across multiple metrics. Total revenue grew 11% year over year with the advertising business up 10% to $18.3 billion and "other" (mostly from Oculus) up 40% to $366 million. Monthly active people using Facebook, Instagram, WhatsApp, or Messenger grew 14% to 3.14 billion, and monthly active users of Facebook alone grew 12% to 2.70 billion. Free cash flow (revenue less cash operating and capital expenditures) dropped to $514 million from $4.84 billion a year ago, but that included the $5.0 billion Federal Trade Commission settlement payment in April. 

Facebook said it expects its top-line growth to continue at a similar pace in the third quarter, boosted as the world continues to migrate to all things digital. Though the surge in monthly users could ease or even decline in some markets, the social media leader said it will benefit as restrictions to halt the pandemic gradually ease. It's a much slower revenue growth rate than shareholders have grown accustomed to in years past, but it could have been far worse given the state of world affairs. And in the meantime, Facebook's profit margins remain incredibly high (32% operating margin in the latest period), giving it the ability to invest in new areas of growth like its Facebook Shops deal with Shopify and its $5.8 billion investment in India's Jio Platforms e-commerce project.

Following the earnings report, shares trade for 31 times trailing 12-month earnings. It's a high price tag, but in a year pummeled by various headwinds, Facebook is still in growth mode as the world economy starts to rebound. I'm still a buyer at these levels.

Someone pictured off screen pressing a Facebook "like" icon in the foreground.

Image source: Getty Images.

High-speed internet is where it's at

Comcast is another company that has had plenty of troubles to contend with lately, and it didn't fare nearly as well as Facebook did during the second quarter. Cord cutting remains a drag on the communications and entertainment giant, and the closure of theme parks, movie theaters, and sports (which means lower broadcast ad revenue) conspired against the company as well. The top line fell 12% year over year to $23.7 billion, driven by a 25% decline at NBC Universal and a 13% decline at Sky in Europe. 

But it's the cable segment that makes Comcast tick, accounting for over 60% of revenue and 78% of total earnings (as measured by adjusted EBITDA, or earnings before interest, tax, depreciation, and amortization). And even though the company reported that it lost another net 477,000 cable TV customers -- ending the period with a total of 20.4 million connections -- high-speed internet net additions totaled 323,000. With 29.4 million internet subscribers now, Comcast's flagship cable segment posted revenue that was flat year over year, but adjusted EBITDA increased 6%. 

Also of note was NBCUniversal's launch of the Peacock TV streaming service, which was revealed to have 10 million subscribers. That should help offset cable TV losses as the streaming service's ad income starts to kick in. Of course, the overall picture won't improve until filmed entertainment (which is heavily dependent on movie theaters reopening) and theme parks get going again (Universal Studios Japan and Orlando are operating again on a limited basis). But in the meantime, internet connectivity is an important modern staple that is keeping Comcast afloat. 

The stock is down 5% so far in 2020, but trading for 17.2 times trailing earnings, Comcast looks like a solid bet as it starts to pull itself out of its pandemic rut. 

Digital payments are down but far from out

E-commerce, digital payments, and a general transition away from cash were already long-term growth trends, but in-person payments got jolted during the economic lockdown. On the one hand, that's been a good thing for Mastercard, as it benefits from the general war on cash. But with many card transactions taking place in person and certain industries like travel all but eliminated, the world's second-largest digital payments network took a hit the first half of 2020. 

Revenue growth of just 3% in the first quarter (negatively impacted by the economic shutdown in the second half of March) preceded a 19% decline in the second quarter to $3.3 billion, and net income tumbled 31% to $1.4 billion -- pretty ugly. So why Mastercard stock now? 

First, there's those profit margins. Even in times of distress, Mastercard's net profit margin was a whopping 42%. That provides ample liquidity for the company to continue to invest in new payment technologies (like touchless payments and data security), as well as return capital to shareholders (via its 0.5% dividend and share repurchase program, which resumed at the tail end of the second quarter). And global transaction volumes are already rebounding. While cross-border volumes were still down double-digits from a year ago at the end of July, Mastercard revealed its volumes are back in growth mode in the U.S. And though 2020 will almost certainly end in the negative for the top line, this is a resilient fintech leader that will be positioned for strong growth once again in a post-COVID-19 world.

That expectation for Mastercard to return to growth mode sooner rather than later is evident in the premium the shares carry, currently going for 42.7 times trailing 12-month earnings. Though it's still down some 10% from all-time highs, Mastercard stock is actually 3% positive for the year. With e-commerce, contactless payments, and data security serving as long-term secular growth trends that should last for years, this remains a staple in my portfolio that I will continue to add to following the last report card.