Image source: Getty Images. 

It has been a tough couple of years in the energy sector, but the worst just might be over. Not only have oil prices risen sharply off the bottom, but there are signs on the horizon that the oil market could be nearing a stabilization between supply and demand. Those improving market conditions have the potential to fuel strong gains for energy investors in the years ahead, if they're invested in the right stocks. Three of the top energy stocks with a lot of upside to an improving market are Halliburton (NYSE:HAL), National Oilwell Varco (NYSE:NOV), and EOG Resources (NYSE:EOG).

Beaten down but not broken

Halliburton has hit a rough patch. After 18 months of trying, the oil-field service company was recently forced to abandon its pursuit of rival Baker Hughes (NYSE:BHI) due to regulatory concerns. Furthermore, the company has experienced a significant deterioration in its business due to the deep downturn in the oil price. That being said, it would appear that the worst is now in the rearview mirror.

With oil prices heading higher, oil producers are starting to think about putting rigs back to work. More rigs working will drive higher service volumes for Halliburton, which will eventually lead to improved margins. Also, the company is focused on fixing the holes it has in its product lines, with plans to do so through internal growth, investments, and selective acquisitions. Added up, the recovering oil market plus Halliburton's focus on improving its weaknesses should yield robust returns for investors through the next upcycle of the oil market.

Equipment won't last forever

Like Halliburton, oil-field equipment manufacturer National Oilwell Varco has been deeply impacted by the downturn in the energy sector. Weak oil prices caused energy companies to significantly cut back on spending, leading many to use up their spare parts or delay repairing equipment, which cut deeply into National Oilwell Varco's sales. However, with oil prices rising, it will provide oil companies with the cash flow they need to restock or make repairs.

Not only is there likely to be a lot of pent-up demand met in the early stages of the recovery, but National Oilwell Varco has spent the entire downturn looking for acquisition opportunities to position itself for the eventual upturn. The company recently announced a deal and its balance sheet strength puts it in a strong position to complete additional acquisitions before valuations start to skyrocket. Overall, National Oilwell Varco is well positioned not only for a sharp bounce-back of its legacy business, but to capture new growth opportunities as the market begins to recover.

Oil growth engine ready to restart

Prior to the cheapening of oil prices, EOG Resourceswas the fastest-growing, large-cap oil company in America. However, the company slammed on the brakes when oil prices started to collapse. Instead, it shifted its focus from growth to improving its returns, which really paid off. Through a combination of efficiency gains and innovations, it has delineated a huge inventory of premium drilling locations, which are those that are not only marginally profitable at $30 a barrel, but can deliver triple-digit returns at just a $60 oil price.

With the company now reset to be successful at low oil prices, it can quickly resume high-return growth with just a little bit more improvement in the oil price. It's that high-return growth in an improving oil market that makes EOG Resources such an appealing energy stock to buy right now.

Investor takeaway

With the oil market starting to show signs of stabilization, now could be one of the best times to buy energy stocks. That said, don't just buy any energy stock. Stick with the top-tier companies like Halliburton, National Oilwell Varco, and EOG Resources just in case prices take another tumble. All three have tremendous upside in the improving oil market, without the downside all the way to zero that is a real risk for some of their weaker peers.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.