Oilfield services companies have been the stock market's whipping boys during the industry downturn, and for good reason.

When oil prices are low, explorers and producers don't drill and thus don't need their products and services. Many of these providers also borrowed heavily to expand during the good times only to be pounded when oil prices went south starting in 2014.

With oil prices stuck below $50 per barrel and $110 billion worth of debt coming closer to maturing or expiring over the next five years, $21 billion in 2018, according to Moody's Investors Service, conditions are probably going to get worse before they get better.

Stalwarts such as Schlumberger (SLB) - Get Schlumberger NV Report , Halliburton (HAL) - Get Halliburton Company (HAL) Report and Baker Hughes (BHI) are expected to weather the storm, of course. But there are a few smaller oilfield services companies out there that continue to have solid margins and generate free cash flow. They include Tetra Technologies (TTI) - Get TETRA Technologies, Inc. Report , Natural Gas Services Group (NGS) - Get Natural Gas Services Group, Inc. Report and Patterson-UTI Energy (PTEN) - Get Patterson-UTI Energy, Inc. Report

Jason Wangler, an analyst at Wunderlich Securities, said in a report Tuesday that he continues to favor Tetra over most other oilfield services companies. "We feel that TTI doesn't get enough credit for its positive traits given it is admittedly more complicated than some purer plays," he said.

TheStreet Recommends

The Woodlands, Texas-based company, which is led by CEO Stuart Brightman, does have multiple business segments. Its compression unit, which includes its separately traded CSI Compressco (CCLP) - Get CSI Compressco LP Report , remains its cash cow and will only get better as natural gas prices go higher, Wangler said. Others include its fluids segment, which has a nice onshore project in West Texas and is ramping up with other projects using its Neptune completion product that should help drive better sales and margins in the second half and through next year, Wangler said. Tetra also has an offshore unit that should add revenue with its current projects but could also be sold, a move that would add cash, simplify the company and smooth out its quarterly results, Wangler said.

The analyst admits Tetra's balance sheet is a bit deceiving, as most of the debt is on CCLP but shows up at Tetra given its ownership of CCLP's general partner and so many of the shares. But with only a 2 times debt-to-Ebitda multiple, he thinks the company is in great shape and expects it to use its free cash flows to pay down the debt on its resolver through the rest the year.

With Tetra trading at 8 times next year's estimated enterprise value/Ebitda versus its peers at 13 times, Wangler thinks there's ample value in the company's shares, and as such, has a buy rating on the stock with a $9 price target.

Wangler said Natural Gas Services, led by CEO Steve Taylor, is also doing well, turning 50 cents of every dollar into cash through its core rental business even though its product sales segment is off. He has a buy rating on that stock with a $29 price target.

The analyst also likes contract driller and pressure pumping provider Patterson-UTI, which is led by CEO Andy Hendricks. But with oil prices where they are, he's waiting for a better entry point for what he calls a "top-tier" name with exposure to both drilling and well completion work. He has a hold on the stock with a price target of $21 per share.