What happened Shares of FedEx (NYSE: FDX) gained 20.1% in July, according to data provided by S&P Global Market Intelligence, with more than half of that gain coming on the first day of that month. The company delivered earnings that reassured investors FedEx was holding up well during the pandemic, and that gave a lift to the stock. FDX data by YCharts So what FedEx did well in July, but the biggest news item propelling the stock higher in the month actually came on July 31. After markets closed that night, the company reported fiscal fourth-quarter earnings of $2.53 per share on revenue of $17.4 billion, easily topping consensus analyst estimates for $1.52 per share on sales of $16.5 billion. We went into earnings season knowing COVID-19 was going to impact transportation companies, but we weren't really sure whether the net effect would be positive or negative on the bottom line. The pandemic has slowed industrial production and changed shipping patterns, but it also has led to growth in e-commerce and with it, demand for home deliveries. FedEx in its earnings report said that COVID impacted "virtually all revenue and expense line items," including about $125 million in extra operating costs for added personal protection equipment and cleaning. Image source: FedEx. But the company also reported gains in residential shipping, as well as pricing power on trans-Pacific shipments due to passenger airlines cutting flights and not having their cargo holds available. The results led to at least a half dozen analyst price-target boosts in the days that followed, which helped propel the stock higher. There wasn't a lot of company-specific news for the rest of the month to drive the stock higher, but it turned out FedEx was a trend setter when it came to earnings. A series of stronger-than-expected earnings reports by transport companies as the month went on, capped off by FedEx's archrival at the end of July, pushed the entire sector higher. Now what There is reason to hope that the strong quarter wasn't just a one-off. FedEx shareholders endured a miserable 2019 in part because the company was investing in its infrastructure in preparation for handling higher e-commerce volumes. In the early days of the pandemic, there were concerns that the hoped-for stock surge in 2020 would not materialize, but FedEx today appears well-positioned to benefit from COVID-19 trends. There are still risks: FedEx did not provide any guidance due to continued uncertainty about the pandemic and its impact on the overall U.S. economy. But FedEx in July gave long-term investors a lot of reasons for optimism. 10 stocks we like better than FedExWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* David and Tom just revealed what they believe are the ten best stocks for investors to buy right now... and FedEx wasn't one of them! That's right -- they think these 10 stocks are even better buys. See the 10 stocks *Stock Advisor returns as of June 2, 2020 Lou Whiteman owns shares of FedEx. The Motley Fool owns shares of and recommends FedEx. The Motley Fool has a disclosure policy.Source