Investing in the oil and gas industry is primarily an exercise in determining how much one can stomach volatility. For the 150 years or so that we have been consuming and investing in these commodities, prices have gone on a ride wilder than the craziest of roller coasters:

Source: BP outlook of World Energy Factbook.

Some investors can bear to watch their portfolios deliver triple-digit gains only to give back more than half of it. For the rest of us, this idea is terrifying. That doesn't mean we need to shy away from the entire industry, though. Instead, we can build hedges into our portfolios to help take the edge off this volatility.

No, I'm not talking about buying oil exchange-traded funds or other ways to directly buy oil prices -- those are some of the dumbest ways you can invest in this space. Rather, I'm talking about natural hedges in the different parts of the hydrocarbon value chain in which you can invest. Here are four scenarios in which certain investments can help protect your portfolio from being completely whacked on the chin.

Falling oil prices: Refiners
Few things make a refining company happier than when oil prices fall for an extended period of time. The only way that could be better for them is if crude oil is cheap and in bountiful supply and demand for refined products such as gasoline remains high enough to keep prices for the products up. Refining companies live and die by what is known as the crack spread, or the difference in price between the barrel of crude it processes and the price at which it can sell the refined products. So cheap pricing for its feedstock -- crude oil -- has a tendency to increase crack spreads, and thus operating margins. 

Two particular companies worth a quick look in the refining space are Holly Frontier and Northern Tier Energy. Both have carved out unique niches in the refining space and have set themselves up to succeed in most market conditions, but they really shine when oil prices are falling.

Flat oil and gas prices: Pipelines
As you can see from the chart above, oil prices are rarely static for very long, and the same can be said for natural gas prices. While natural gas prices haven't always followed oil prices in lockstep, prices have bounced around just as much

Henry Hub Natural Gas Spot Price Chart

Henry Hub Natural Gas Spot Price data by YCharts.

In those less than common times when oil and gas prices are pretty flat, the companies that grow are those that increase overall production. Sure, this helps the producers, but the greatest beneficiaries from stable oil prices with steady output increases are pipeline operators. 

Just about all pipeline companies try to isolate themselves from the actual price of commodities by charging fixed fees to use their transportation networks, and periods of flat prices and steady production growth allow these companies to both plan their next pipeline addition to grow revenue and to turn those increasing volume fees into high cash payouts to shareholders. In times of flat prices, those high-paying dividends can make up for a lack of share price growth. 

Cheap natural gas: LNG exporters and other major gas consumers
The proliferation of natural gas production in the United States has opened a whole bunch of industrial opportunities we thought had long gone the way of the dodo. This boom in production, though, has triggered a structural price reset ofnatural gas prices. This has reopened the opportunity for energy-intensive and natural gas-consuming industries to return to the U.S.

Henry Hub Natural Gas Spot Price Chart

Henry Hub Natural Gas Spot Price data by YCharts.

I can't say with 100% certainty that natural gas will remain at these bargain-basement prices, but a handful of U.S. natural gas producers can eke out some small profits even when natural gas costs about $3 per thousand cubic feet. So while it natural gas might not always be as low as they are today, chances are they won't climb to levels we see in other countries.

This translates to a major advantage to companies that consume immense amounts of natural gas. Today, that is mostly chemical manufacturers and power companies, but industry analysts and the U.S. Energy Information Administration estimate that by 2020, close to 33% of all domestic natural gas will be used for LNG exports. If these companies can lock in cheap prices, they have a good opportunity to reap some nice profits from selling that same gas abroad.

One company that looks to be far and away the largest consumer of natural gas during this time is Cheniere Energy (NYSEMKT: LNG). Its two LNG export facilities and partnerships with two others total 60 million tons per year, which would not only make it the nation's largest single consumer of natural gas, but also the largest LNG exporting company by a wide margin. 

Expensive natural gas: Alternative energy investments such as solar
Yeah, I know I just said there is a limited chance of U.S. natural gas becoming really expensive. So let's call this a contingency plan in the event it does happen. Electric power production is the primary consumer of alternative energy today; based on the current costs to manufacture and operate a new power generating facility, natural gas, wind, and solar are the three least expensive options, as seen in this table from analyst group Lazard:

Source: Lazard.

This means that when companies are choosing their next power generation investment, chances are it will be one of these three choices. This bodes well for utility-scale alternative power manufacturers such as First Solar for solar and General Electric for wind, and there are plenty of compelling reasons to invest in the space today anyways.

However, if natural gas prices were to increase significantly -- the chart above assume $4.50 per thousand cubic feet of gas -- it would be an added boost to the economics of alternative energy and could make them even more compelling investments. 

What a Fool believes
The undulating waves of the oil and gas market are enough to make almost anyone seasick. If you can't handle the ups and downs, there are ways to naturally hedge your portfolio. The ideas and companies mentioned above are a decent starting point for creating hedges to other energy investments, and could help settle some of the waves in the storm.