Inflation is running at a 40-year high and is threatening to throw the U.S. economy into a recession. It exacts a tragic human toll by devaluing the dollar, especially for those in the lowest income levels. And it also imposes a heavy burden on Wall Street, causing the stock market itself to hover just above official bear market territory.

There is little relief in sight, too, or rather the prescriptions for gaining control of rampant inflation are almost as pernicious as rising prices for basic goods and services. Interest rates are on the rise and will almost certainly jump higher in the months ahead in a bid to cool the economy down, perhaps even cause it to contract. In fact, U.S. gross domestic product declined 1.4% in the first quarter.

Person counting $100 bills.

Image source: Getty Images.

Yet bear markets have always proven to be the best time to buy. Particularly, if you bolster your portfolio by buying stocks in industries that are resilient against the ravages of inflation and then give them time to play out their investment thesis, an economy suffering the ill effects of "stagflation" could prove to be a time for you to still make money.

It's why I find the energy sector particularly intriguing, and the following large-cap stocks below should prove to be excellent defensive plays during inflationary periods.

Offshore oil platform.

Image source: Chevron.

Oil and gas majors

Gas prices were rising long before Russia invaded Ukraine, but anyone that's filled their gas tank recently knows the situation has worsened since the war began. The average price of a gallon of gas is at record levels despite efforts to curb them such as the release of the largest amount of oil ever from the country's strategic reserves. 

The environment has made it more advantageous to invest in exploration once more and is one of the reasons I think oil majors like ExxonMobil (XOM 1.15%) and Chevron (CVX 1.54%) are excellent investments. The two have a record of sharing profits with investors and I believe investors can't go wrong adding the two to their portfolios.

Exxon is the largest energy stock by market cap, and it has prioritized increasing expenditures on profitable projects while keeping production stable. Guyana holds significant potential as it could be producing as much as 1 million barrels of oil per day by the end of the decade, making it it one of the top 20 oil-producing countries in the world.

While it took a $3.4 billion hit due to its withdrawal from Russia, Exxon is also pledging to triple its stock buyback program by repurchasing $30 billion worth of stock by the end of the year. 

Similarly, Chevron has committed to buying back between $5 billion and $10 billion worth of stock every year through 2026. It's able to do so because its upstream, midstream, and downstream assets generate considerable cash flows -- even during extreme global crises. As one of the biggest vertically integrated energy leaders, Chevron has been able to raise its payout for 35 consecutive years, making it a Dividend Aristocrat.

Oil pump worker.

Image source: Getty Images.

A supporting role

But there are other ways to play the space because energy stocks in general are on a tear. The sector has been the best performer by far over the past year, generating returns of 43% over the last 12 months while energy stocks are up 34% in 2022 alone. 

Oilfield services leader Baker Hughes (BKR 1.24%) should benefit from the high-price environment, despite a disappointing first-quarter earnings report due to supply chain problems. It provides equipment, technology, and manpower to the oil and gas industry and should profit from increased activity and spending levels in the field.

Chairman and CEO Lorenzo Simonelli told analysts last month, "We believe that we are well-positioned to benefit from an extended cyclical recovery in (oilfield services and equipment) and longer term structural growth trends in LNG, new energy and industrial asset management. Importantly, we expect to generate strong free cash flow as the cycle plays out."

Petrochemical facility.

Image source: Getty Images.

Moving energy from point A to point B

The likelihood of the energy sector remaining on an extended growth trajectory is why I also find the midstream space in energy to be one of the more exciting places to invest, with Enterprise Products Partners (EPD 1.41%) being my favorite. It has tens of thousands of miles of pipelines, dozens of natural gas liquids (NGLs) processing plants, billions of cubic feet of storage for natural gas storage, and over several hundred million barrels of storage capacity for NGLs, crude oil, refined products, and petrochemicals.

It makes its money through long-term, fixed-fee, or take-or-pay contracts, so Enterprise gets paid regardless of whether its customers accept delivery of the product or not. It then returns profits to investors through a generous 6.9% distribution, which it has increased for 23 consecutive years.

Not only is Enterprise Products one of the largest publicly traded partnerships in the U.S., it's also the world's largest exporter of NGLs that should see demand for them increase going forward.