Oil prices may be down somewhat from their recent highs, but the world is still in the grip of high inflation, and the Federal Reserve has committed to getting that in check. To do so, the central bank is hiking interest rates, which is putting the brakes on economic growth. But if the Fed can't fight inflation and also stick a soft landing for the economy, it's quite possible the U.S. will see a reprise of the dreaded stagflation of the 1970s. 

Hardly seems the time to be investing in industrial stocks, right? Yet when times get tough, you want to make sure your portfolio is chock-full of quality companies, and many industrial stocks could do well even in a soft economy. 

Man working at a factory machine.

Image source: Getty Images.

Moreover, it's important not to be on the sidelines when the market rebound happens. Over the past two decades, the stock market averaged returns of 9.5% a year. However, if you had let the big downturns scare you out of stocks and waited for the dust to settle before getting back in, and thereby missed just the 10 best days in the market, your overall returns would have been nearly cut in half to just 5.3% a year.

These two solid industrials are worth investing in now, ahead of the market's recovery. You'll be glad you own them in the years to come.

Raytheon Technologies

Raytheon Technologies (RTX -1.10%), the second-biggest U.S. defense contractor, generates 48% of its $64 billion in annual revenue from the U.S. government, but it also has an extensive private commercial aerospace business that accounts for another 35%. Sales of military hardware and commercial aviation products to foreign governments round out the rest.

Military sales provide the foundation upon which Raytheon will continue to grow, but it's the commercial aerospace business that it will rely upon to help achieve its target of $10 billion in free cash flow by 2025, up from $6 billion this year.

Russia's war in Ukraine and China's saber-rattling over Taiwan are enough to ensure this defense contractor's continued military sales growth, while its Pratt & Whitney and Collins Aerospace units are expected to enjoy reasonable growth too. As a major supplier to both Boeing and Airbus, Raytheon has firm ground to stand on.

In its short life so far -- the company was formed in 2020 from the merger of the aerospace businesses of United Technologies and Raytheon -- it has also been consistently hiking its dividend.  That makes it a good industrial stock for anyone's portfolio.

Caterpillar

Heavy equipment manufacturer Caterpillar's (CAT 1.99%) business is spread across numerous industries, and while that diversification can in some ways protect it from sector-specific issues, it also puts the company at risk during broad economic declines. However, there are good reasons to believe this Big Cat can muscle through the next downturn.

Caterpillar is the world's leading manufacturer of construction and mining equipment, off-highway diesel and natural gas engines, industrial gas turbines, and diesel-electric locomotives that are used in the construction, mining, energy, and transportation industries.

Despite ongoing supply chain problems, Caterpillar is still delivering double-digit revenue growth and per-share profits that were up 22% from last year. Even in the current global economic situation, it continues to report "healthy demand across most of our end markets" and now has a backlog of $28 billion -- up $2 billion from the first quarter -- that should keep its sales growing well beyond this year. 

Although the energy sector was the big driver of backlog growth this quarter, President Biden's 2021 infrastructure bill could be a catalyst for growth in the years to come.

Caterpillar has paid dividends every year since it was founded in 1925, and has paid a quarterly dividend since 1933. It has increased its payout for 28 consecutive years, most recently in June, when it raised it by 8%. At the current share price, that dividend yields 2.5% annually.