What: Shares of Unit Corporation (UNT) were soaring on Friday, up more than 20% by 3:00 p.m. EDT. Fueling today's rise was an analyst upgrade.

So what: Raymond James upgraded Unit from market perform to strong buy, giving it a $20 price target. That's based on the thesis that commodity prices and U.S. drilling rig activities will be much higher in 2017, both of which are important to Unit because it's not only a producer, but a drilling contractor, too. As such, it should see higher earnings and strong production growth.

The upgrade comes on the heels of the company's first-quarter report earlier this week, where the company missed on both the top and bottom lines. However, despite that poor showing, the company did have some positives, including selling $37.4 million in non-core assets and successfully amending its bank credit facility, which gives it a bit more breathing room until commodity prices improve.

Unit really needs to see that improvement, especially in its contract drilling segment. Currently, the company has just 13 of its 94 drilling rigs under contract, with just six under contract for more than six months. That's an issue given the continued slide in the U.S. rig count, with Baker Hughes (BHI) announcing today that the rig count has fallen for seven straight weeks. Further, Baker Hughes notes that oil drillers have now idled 80% of the rigs that had been working at the peak in late October of 2014. That has hit Unit hard, with its operating profit in that segment now down 76% over the past year.

Now what: With optimism growing that oil prices have not only bottomed, but could be heading much higher, it has Raymond James very optimistic about Unit's future. That's because it will benefit from higher cash flow on its production as well as by putting its drilling rigs back to work. That said, while oil might have bottomed, Baker Hughes reminded us that the rig count still has yet to hit bottom.