Oil and natural gas markets are anything but boring. For investors, they can be downright exciting at times, both to the upside and to the downside. It's the nature of the business and some level of volatility is inevitable. As an investor, if you recognize this truism and accept it, you can position your portfolio to manage it.

Here are some ways you can do that.

When it comes to energy prices, what goes up also goes down

The chart below shows the price of a barrel of Brent crude -- a key global oil benchmark -- over the past decade. It's fallen below $20 per barrel and topped $120 per barrel, moving up and down a lot within that range. Natural gas is just as volatile.

Those swings are par for the course when it comes to the energy sector.

Brent Crude Oil Spot Price Chart

Brent Crude Oil Spot Price data by YCharts.

As an investor in energy stocks, you should be focused on the impact that volatility will have on companies that extract oil and/or natural gas. Clearly, revenue and earnings for energy companies are going to vary widely from year to year. The chart below overlays the annual top and bottom lines of energy giant ExxonMobil (XOM -2.78%) on top of the price line for Brent crude. Unsurprisingly, energy prices play a big role in ExxonMobil's financial performance.

Brent Crude Oil Spot Price Chart

Brent Crude Oil Spot Price data by YCharts.

How to deal with volatile energy prices

If you plan on owning energy stocks, you have to embrace the inherent cyclicality of the sector. The question is, what do you do with that knowledge? 

For long-term investors who simply want exposure to the energy sector for diversification purposes, the answer is likely to be diversification. Just buy a sector-tracking exchange-traded fund (ETF) like Vanguard Energy Index ETF (VDE -0.80%). It has modest expenses and will provide you with a diversified portfolio of energy stocks. That's basically a "set it and forget it" energy investment that you might adjust on a yearly basis if it grows beyond or falls below your target allocation. 

But you could also think about buying shares in a company like ExxonMobil, which is an integrated energy giant. Its business spans from the upstream (drilling) through the midstream (pipelines) and on to the downstream (refining and chemicals). That diversification helps to soften the impacts of rising and falling energy commodity prices, though it doesn't fully protect it from those swings (note the chart above).

However, ExxonMobil has long focused on maintaining a strong balance sheet, so it can support its business by taking out debt during weak patches. That allows it to keep investing in its operations and paying a reliable dividend. When oil markets recover, it pays down its debts. This model has allowed ExxonMobil to increase its dividend annually for more than four decades. Another company investors should consider for the same reasons is Chevron (CVX 0.37%), which has a 36-year streak of annual dividend increases under its belt.

Brent Crude Oil Spot Price Chart

Brent Crude Oil Spot Price data by YCharts.

That said, you could also look for a stock that's leveraged to the ups and downs. Devon Energy (DVN 0.19%) or Pioneer Natural Resources (PXD -2.28%) would fit that bill. Both are U.S. onshore drillers that have tied their dividends to their financial performance. When oil and natural gas prices are rising, their shareholders are likely to benefit from both rising stock prices and higher dividends. When energy prices are dropping, they'll get the opposite. This could offer more active investors a hedge of sorts against the prices of energy in day-to-day life (for things like heating and transportation). 

Brent Crude Oil Spot Price Chart

Brent Crude Oil Spot Price data by YCharts.

Then there are companies like Enbridge (ENB -1.21%) and Enterprise Products Partners (EPD 0.45%). These are two of the largest midstream players in North America. They own the energy infrastructure that helps to move oil and natural gas around the world and, largely, charge fees for the use of those assets. These types of stocks tend to have high yields backed by reliable cash flows, which income investors will appreciate.

That said, dividends are likely to represent the lion's share of an investor's total return in these companies. At their current share prices, Enbridge's yield is 8.3% and Enterprise's is 7.3%. Note, however, that while energy prices won't have as big an impact on their financial performances, that doesn't mean that their stock prices won't broadly ebb and flow along with the sentiment around the energy sector.

Choose wisely before you get into the energy sector

There's no single right answer when it comes to dealing with volatile energy prices. For example, energy prices are rising today, and so, too, are the prices of many energy stocks. That's likely to be a temporary trend because, eventually, oil prices will fall again. The key is to pick an investment option that fits your investing needs and, just as importantly, suits your emotional makeup. 

If you like consistent income, go for a midstream company or an integrated energy giant. If you want to benefit as much as possible from energy commodity upturns, a focused driller like Pioneer Natural Resources might make more sense. And if you just want the diversification benefit of having energy exposure, buy a broadly diversified energy ETF. Just don't go into the sector expecting anything other than dramatic and sometimes swift energy price swings.