Investors haven't had much certainty lately about the prospects for the stock market and the broader global economy. With inflation, rising interest rates, and sluggish business conditions all coming at the same time, many companies are struggling to make it through the 2022 bear market.

Yet lately, the Dow Jones Industrial Average (^DJI 0.69%) has emerged as a pocket of relative strength, and it's down less than other major market indexes so far this year. That's largely because many of the companies in the Dow Jones didn't rise as much as smaller high-growth stocks elsewhere, avoiding the high expectations that can cause so much disappointment when a business can't achieve its goals. On Thursday, Dow components Caterpillar (CAT 1.58%) and McDonald's (MCD 0.47%) proved just how valuable it can be to have solid underlying businesses in your stock portfolio.

Caterpillar flies upward

Shares of Caterpillar jumped nearly 6% on Thursday morning. The heavy-equipment manufacturer's third-quarter financial results showed continued strength even in the face of deteriorating macroeconomic conditions that might ordinarily lead purchasers to hold off on taking on major expenses.

Caterpillar's quarterly numbers were impressive. Revenue jumped 21% to $15 billion, as the company enjoyed both higher sales volume and increased pricing. Operating profit showed an even steeper jump of 46% year over year to $2.43 billion, with the company managing to use its pricing power to keep its sales climbing at a faster pace than its expenses were increasing. Adjusted earnings of $3.95 per share were 48% higher than in the year-ago period.

All of Caterpillar's business segments contributed to its overall strength. Sales to resource industries customers saw the biggest year-over-year rise at 30%, with segment profit soaring 81%. Construction-related sales were 19% higher and enjoyed a 40% rise in profit, with particularly good results in the Americas that overcame flat performance in Europe and the Asia-Pacific regions.

Best of all, Caterpillar expects the fourth quarter to see the highest sales of the year, reflecting usual seasonal trends. It intends to keep using its pricing power to offset cost increases, and that should lead to continued strong profits for Caterpillar even as other companies have to deal with less resilient demand.

McDonald's still looks golden

Meanwhile, in the fast food area, McDonald's shares rose nearly 3%. The company reported extremely good results in the third quarter that reflected an ongoing return to restaurant locations following the initial couple of years of the COVID-19 pandemic.

McDonald's saw global comparable sales rise nearly 10%, citing gains across all of its geographical segments. In the U.S., comps posted a better than 6% rise, marking the ninth straight quarter in which McDonald's saw comparable sales grow. Overall revenue did drop 5% year over year, and adjusted earnings of $2.68 per share were down about 3% from year-ago levels. But those results were better than many investors had anticipated, especially given a 6- to 7-percentage-point impact from the strong U.S. dollar.

Much of McDonald's success has come from its embracing the digital channel, and the fast food giant reported $7 billion in digital sales in its six top markets. That represents more than a third of total sales in those markets, showing the extent to which customers have adopted digital innovation to be more efficient in their own lives.

Dividend investors were also pleased with McDonald's decision to boost its quarterly payout by 10% to $1.52 per share. With the company having historically performed well even in recessions, many investors believe McDonald's stock is a timely investment right now.