Investors came into the new week with mixed views on where the stock market should move. Premarket gains turned into losses in early trading, only to reverse higher and lead to mixed results. Investors are still parsing out how inflation, interest rates, and economic impacts will counterbalance each other. As of 11:30 a.m. ET, the Dow Jones Industrial Average (^DJI 0.56%) was up 57 points to 31,558. The S&P 500 (^GSPC -0.88%) gained 8 points to 3,920, but the Nasdaq Composite (^IXIC -2.05%) was still down 13 points to 11,595.

Often, stock market gains have come from broad-based moves across many sectors. That wasn't the case on Monday, however, as just about all of the rise in major market benchmarks stemmed from the strength of one industry: oil and natural gas.

Big winners in the oil patch

It wasn't hard to see the impact that energy stocks had on the market on Monday. Upward moves of 3% for ExxonMobil (XOM 1.15%) and 2% for Chevron (CVX 1.54%) showed that even the largest integrated oil companies benefited from favorable conditions to start the week.

Smaller exploration and production companies fared even better. Devon Energy (DVN 0.78%) climbed nearly 8% on Monday morning, while Marathon Oil (MRO 0.36%) posted a 6% gain. Among the tiniest names, Ranger Oil (NASDAQ: ROCC) picked up more than 12%, while Vermilion Energy (VET 0.85%) moved higher by 11%. Helping boost E&P companies was the rising price of crude oil, with West Texas Intermediate climbing nearly $2 per barrel to move above the $109 mark.

Other facets of the energy industry also contributed to overall gains. Among refinery companies, Valero Energy (VLO 0.86%) picked up more than 6% on the day, while H.F. Sinclair (DINO 1.01%) came close to matching that 6% rise. Phillips 66 (PSX 0.91%) managed a more modest 4% rise. Markets for refined products helped bolster the prospects for refiners, as both unleaded gasoline and diesel fuel remain at highly attractive levels compared to the cost of the crude that goes into making them.

Foreign energy stocks also added to the bullishness. Norway's Equinor (EQNR 0.29%) saw its stock rise by more than 5%, while South America's Petrobras (PBR 5.71%) saw shares gain more than 7%. Strength in foreign currencies compared to the U.S. dollar also likely played a small role in the gains in international energy company shares.

The future of energy

At this point, there's a huge amount of uncertainty about the future direction of the energy markets. Oil and natural gas prices were already spiking due to the resurgence of demand as the global economy reopened after the worst of the COVID-19 pandemic. Then, when Russia invaded Ukraine, oil and gas prices moved still higher.

Fundamentally, the Russian part of the equation hasn't yet fully played out. Although Western nations were quick to start the clock on sanctions, some of the most onerous restrictions haven't yet taken effect. Moreover, there's growing concern that if countries in Western Europe can't get natural gas from Russia, they'll find it impossible to replace lost supplies from other sources. Even large capacity gains from liquefied natural gas terminal operator Cheniere Energy (LNG 0.96%) won't come close to meeting all of Europe's needs.

Interestingly, renewable energy stocks haven't reacted the way they normally do when oil prices rise. Typically, investment in solar, wind, and other renewable sources goes up with crude, because the potential payoff is greater in a strong energy market. However, there's still a lot of skepticism about how long oil prices will stay high. That's limiting investment not just in the oil patch but in adjacent areas as well.

Investors have to understand the value of a diversified portfolio that includes exposure to a wide range of industries. Sometimes, if you leave one type of stock out, it can end up costing you, as we've seen with energy so far in 2022.