The S&P 500 (^GSPC -0.46%) ended Thursday down 0.38% after gross domestic product and unemployment numbers painted a picture of an economy struggling to recover. GDP declined at an annualized rate of 32.9% in the second quarter as stay-at-home orders ravaged the economy, and unemployment claims rose for the second straight week to 1.434 million.

While the pandemic has dealt serious blows to many companies, UPS (UPS 0.53%) is not one of them. The delivery company reported double-digit growth for the second quarter driven by a surge in residential deliveries.

Tech giants Apple (AAPL 0.52%), Amazon (AMZN -1.65%), Alphabet (GOOG -1.96%), and Facebook (META -10.56%) reported earnings after the market closed, with all four stocks rising after hours on solid results.

Packages.

Image source: Getty Images.

UPS benefits from an e-commerce surge

Average daily volumes were up 20.9% for UPS in the second quarter, driven by soaring residential volume, healthcare shipments related to COVID-19, and outbound demand from Asia. Consumers are embracing e-commerce during the pandemic, and UPS is benefiting.

UPS reported total revenue of $20.5 billion, up 13.4% year over year and more than $3 billion higher than the average analyst estimate. Adjusted earnings per share of $2.13 beat analyst expectations by a whopping $1.05, rising 8.7% from the prior-year period.

In the United States, UPS handled 21.1 million packages per day on average, and business-to-consumer shipments grew by 65%. Internationally, daily volumes spiked 9.8% thanks in part to a rise in cross-border e-commerce in Europe.

While UPS is thriving, the company is not providing any guidance due to the uncertainty surrounding the economic recovery. If the recession in the U.S. is long and painful for consumers, sluggish demand for a wide variety of products could start to offset any increase in e-commerce shipments.

Shares of UPS soared 14.3% on Thursday. The stock is now up about the same percentage year to date.

After hours: Big tech reports earnings

Apple, Amazon, Alphabet, and Facebook reported their quarterly results after the market closed Thursday.

Apple managed to grow revenue by 11% to $59.7 billion despite the pandemic, a result that easily beat analyst expectations. iPhone revenue was up slightly in the quarter, and revenue from Macs, iPads, and other hardware posted growth as well. The services business grew by 14.5%, and EPS was up 18% to $2.58.

Amazon saw total revenue rise 40% to $88.9 billion, with EPS roughly doubling from the prior-year period. Sales in the North American segment jumped 43%, while Amazon Web Services saw 29% growth. The e-commerce and cloud computing giant expects to produce revenue between $87 billion and $93 billion in the third quarter.

Alphabet reported revenue of $38.3 billion, down 2%, and EPS of 10.13, down 29%. The advertising business was hit by weak demand related to the pandemic, with total advertising revenue down 8%. Google Cloud grew revenue by 43%, helping to offset some of the ad weakness.

Facebook reported an 11% rise in revenue to $18.7 billion, and a near-doubling of EPS to $1.80. Daily active users surged 12% to 1.79 billion. The company expects the third quarter to look a lot like the second quarter, with a similar advertising revenue growth rate.

In after-hours trading soon after the earnings reports were released, Apple was up 4.9%. Amazon was up 5%, Alphabet was up 0.2%, and Facebook was up 6.1%.