The sharp rebound in oil prices—up more than 20 percent in recent weeks to $46 per barrel as the summer driving season winds down—may lead you to consider investing in oil, especially as stocks have recently faltered.

But you should be careful when considering how best to add that commodity to your personal investment portfolio. While the advent of exchange-traded funds (ETFs) has made investing in commodities like gold and oil relatively simple, doing so may seem a smarter move in theory than in practice.

One reason: Some funds that attempt to track the price of oil, such as the United States Oil ETF (ticker: USO) and the iPath S&P GSCI Crude Oil Total Return ETF (ticker: OIL), make investments in futures contracts that imperfectly track the price of the commodity. (Buying the physical commodity itself, the way some gold ETFs do, isn’t practical with barrels of oil.)

An image of offshore oil platforms, an integral part of some energy Exchange-Traded Funds (or ETFs), investment instruments that allow consumers invest in oil.

The Smart Way to Invest in Oil

A recent example illustrates their primary shortcoming: In 2009, the last time oil prices rose significantly, from $34 per barrel to almost $100, investors in OIL and USO captured only a fraction of that gain, short shrifting investors who had bought into the ETFs.

A better approach to investing in oil may be to consider the broadest, as well as the largest, energy ETF: the Energy Select Sector SPDR ETF (ticker: XLE). The Energy SPDR includes large dollops of Big Oil—vertically integrated giants such as Exxon Mobil, Chevron, and ConocoPhillips make up 30 percent of the fund. But the ETF also owns refiners, exploration and production companies (known as E&Ps, or the “upstream” part of energy production), and firms that manage the storage and transportation of petroleum and other energy products.

More importantly, with a broad-based ETF such as XLE, the price is right; it costs investors just 0.15 percent of assets annually. It also currently sports a dividend yield of 3.1 percent, unlike the commodity-based ETFs, which offer no meaningful dividends and have much higher expense ratios: 0.72 percent for USO and 0.75 percent for OIL.