2016 was a great year to be invested in energy stocks in general. Not only were energy stocks the best-performing asset class in the stock market, but oil, gas, and their derivative products were four of the five best-performing commodities for the year. 

And within the energy sector, one group of companies outperformed even more: land rig companies. Four of the nation's largest land drillers -- Nabors Industries (NBR 4.04%), Patterson UTI Energy (PTEN 2.29%), Precision Drilling (PDS 0.89%), and Helmerich & Payne (HP 2.57%) -- all saw share-price jumps in excess of 33%!

After such fantastic gains, one wonders whether these stocks can repeat their performance in 2017, or if Wall Street got a little ahead of itself bidding up these stocks. Let's take a look at what went right for these companies in 2016 and what we can expect for the coming year.

Image source: Getty Images.

A much-needed reprieve

There have been two things really working against rig owners over the past couple of years. The first and most obvious one is the lack of work. Once oil and gas prices started to decline in the second half of 2014, exploration and production companies started paring back capital budgets, which meant less drilling and less need to lease rigs. 

There was another aspect that probably didn't get as much attention, though: Producers have become better at drilling and completing shale wells. The chart below is from EOG Resources (EOG 1.78%), one of the largest shale producers in the U.S. Since 2014, the time it takes to drill and complete a well has declined by more than 40% in all of the major shale basins in which it operates. While EOG has been exemplary in its efficiency gains over the past couple of years, it isn't atypical to see other producers reduce drill and completion times by 20% to 50%.

Image source: EOG Resources investor presentation.

Greater drilling efficiency means producers can drill more wells faster, but it also means that those producers can lease fewer rigs to achieve the same result. When you combine these two factors together, they've led to an incredible drop in total active rigs in the field across the U.S. In May 2016, it's estimated that we hit a 150-year low in rigs.

US Rig Count Chart

US Rig Count data by YCharts.

As you can imagine, this took a heavy toll on the finances of all land drillers. With the exception of Helmerich & Payne, land rig drillers fell heavily into the red over the past two years, and that sent stock prices down big time as a result.

After oil prices hit rock bottom and the rig count bottomed out in May, though, things started looking up for drilling business. Oil above $50 a barrel for many shale drillers is now a price at which they can generate a return, and so they're starting to open their wallets again to contract rigs. 

One little nuance of this change, though, is that the gains in drilling rigs may not be in the areas of the market these rig owners hope for. As Helmerich & Payne noted on some of its conference calls, most of these gains come from private equity companies renting cheap, low-grade rigs to try keep costs at a bare minimum and squeeze a little value out of some distressed assets they bought during the oil crash.

These aren't the kinds of contracts rig owners want, though, because they all spent billions of dollars in recent years investing in high-specification drilling rigs that can handle the complex drilling jobs that more established producers like EOG Resources need. So there is still a large inventory of high-spec rigs from all of these companies still waiting to be put back to work.

Image source: Helmerich & Payne investor presentation.

All that being said, the idea that oil prices are rising and a few producers are going back to work has Wall Street excited about buying up shares of rig stocks, and so we have seen a pretty impressive run-up in stock prices for all of the players this year. 

NBR Chart

NBR data by YCharts.

Encore performance in 2017?

All of those available high-specification rigs waiting in the wings pose both an opportunity and a problem for land drillers. On the one hand, they provide ample opportunity to grow revenue if we continue to see marginal improvements in oil prices and drilling activity. The promises from OPEC as well as other producers such as Russia coupled with the natural decline of oil reservoirs suggests that we could very well see oil stay in or above the $50- to $60-per-barrel range producers have enjoyed lately.

At the same time, having all these available rigs means that competition for contracts is still fierce, and that results in lower day rates. So we could see much higher levels of revenue as more rigs go to work, but they could also go back to work on lower-margin contracts that may not have as large an impact on the bottom line. This is much more of an issue for Nabors Industries and Precision Drilling, as the two have much more onerous debt loads than either Patterson UTI Energy or Helmerich & Payne. It's also worth noting that Nabors is also sitting on a large fleet of legacy rigs. Modern drilling demands means that many of these rigs don't have much economic life left in them.

With all of that being said, there is still reason to think that there is room to run for these companies. We can't rely on earnings-based valuations right now because earnings are non-existent, but if we look at current versus historical-price-to-tangible-book value ratios for these companies, they are all still trading at or below their 10-year historical averages. As earnings adds equity to the books, it should give these companies some room to run in the coming year.

NBR Price to Tangible Book Value Chart

NBR Price to Tangible Book Value data by YCharts.

Investors certainly should expect similar levels of growth from these companies in 2017, but growing demand for rigs and still-reasonable valuations suggest that you haven't necessarily missed the boat yet with these stocks.