Bank of America: It's time to buy oil stocks

Record Rally: A gold medal for stock investors
Record Rally: A gold medal for stock investors

It's no secret that when oil prices rise, energy stocks tag along for the ride.

That's why energy stocks are up 14% this year, following oil's 25% gain so far in 2016. Energy stocks are the second-best performer among the major market groups. Many investors even fear they've already missed the move.

But Bank of America Merrill Lynch came out with an even more bullish call this week, upgrading energy stocks to overweight. The bank predicted crude will surge almost 50% from current levels to $69 a barrel by next June, pushing energy stocks ahead of the rest of the market.

"The rotation into energy may still be in its infancy," Savita Subramanian, equity and quant strategist at BofA, wrote in a report on Tuesday.

While some are skeptical about oil's near-term prospects, BofA believes falling production combined with strong demand will create the biggest supply-demand deficit since 2011.

Related: Oil prices are on fire

History shows that when crude oil prices rise by at least 25%, energy stocks beat the S&P 500 almost 90% of the time, BofA said. The only recent exception was in 2009, when the entire stock market rebounded from the Great Recession.

Another bullish factor: energy stocks remain unloved, despite the recent rally. The sector is the fourth most underweighted in the S&P 500, BofA estimates. The brief tumble below $40 a barrel earlier this month caused a new round of selling.

Energy stocks now make up less than 7% of the S&P 500, down by nearly half from the 2008 peak. BofA said every time that has happened in the past, the sector beat the market over the next three years.

Some energy names are clearly already in rally mode. Five of the top seven S&P 500 stocks this year are energy companies: Southwestern Energy (SWN), ONEOK (OKE), Freeport-McMoRan (FCX), Range Resources (RRC) and Spectra Energy (SE). They've surged between 50% and 99% apiece.

Related: Stocks are hot again. But are they too hot?

Of course, buying energy stocks remains risky. Much of the bullish thesis hinges on the future direction of oil prices -- a notoriously difficult commodity to predict. Crude collapsed from above $100 a barrel in mid-2014 to just $26 in February, a crash few saw coming. And then a dramatic rebound to $50 a barrel in May proved to be short-lived.

Oil prices have arguably become even harder to predict lately. That's because so much depends on U.S. oil production, which is driven by shale players. Shale companies don't have the track record that more established companies do, and many of these new drillers have become vastly more productive just over the past few years.

The other big problem: energy stocks are really expensive in an already pricey stock market.

The energy sector trades at a lofty multiple of 39 times projected profits over the next 12 months, according to Yardeni Research. That's more than double the S&P 500's price-to-earnings (P/E) multiple of 17.

But earnings estimates should get ramped up if oil prices move higher. BofA said its ratio of earnings estimate revisions for energy stocks is sitting at a five-year high. For the energy rally to gain momentum, that trend will need to continue.

CNNMoney Sponsors