What happened

After crashing below $50 per barrel last week, crude bounced back a bit this week, notching its first weekly gain in three weeks. While crude was up less than 1%, and still closed below $50 a barrel, that was a step in the right direction for an oil market that has been under tremendous selling pressure recently. Fueling the optimism was an unexpected decline in U.S. oil inventories, which had worried the market after a string of larger-than-expected increases.

That improvement in oil prices helped lift oil stocks. Further, that bounce, when combined with the release of some positive company-specific news, enabled several oil stocks to notch double-digit percentage gains this week. Leading the way, according to data from S&P Global Market Intelligence, were Seadrill (NYSE:SDRL), Seadrill Partners (NYSE:SDLP), Abraxas Petroleum (NASDAQ:ABAX), Penn West Petroleum (NYSE:PWE), and Resolute Energy (NYSE:REN).

Silhouette of an offshore drilling rig at sunset.

Image source: Getty Images.

So what

Seadrill led the charge this week, rallying about 20%, which also fueled a double-digit rebound for its MLP Seadrill Partners. The catalyst was news that the offshore drilling contractor had reached a settlement following the cancellation of the construction contract for the West Mira drilling rig. Under the terms of the agreement, Seadrill will receive a cash payment of $170 million, which will help bolster its beleaguered balance sheet. Meanwhile, as part of the settlement, Seatankers, which is a related party, agreed to purchase the West Mira. Further, Seadrill will manage the rig and has the rights of first refusal to buy it in the future. Investors clearly hope that this settlement is a sign of more good news to come for Seadrill and Seadrill Partners as the companies work to sort out their balance-sheet issues.

Abraxas Petroleum, meanwhile, soared after reporting a surprising fourth-quarter profit. While the shale driller only earned $1 million, or $0.01 per share, that was better than the $0.01 per share loss that analysts expected. Further, that profit ended a string of seven consecutive quarterly losses. Key to that return to profitability was the fact that costs came in toward the low-end of the company's guidance range, while production hit the midpoint of the forecast despite the fact Abraxas spent 21% less than budgeted. Investors saw this capital efficiency as a sign of good things to come.

Pump jack backlit by the setting sun after the rain.

Image source: Getty Images.

Penn West Petroleum also jumped after reporting better-than-expected fourth-quarter results this week. While the Canadian driller still lost money, its losses have narrowed significantly over the past year, while funds from operations jumped 25% per share. Penn West also raised its 2017 output guidance by 11% from its previous outlook as the company continues to get more bang for its buck. For 2017, Penn West expects to self-fund its 180 million Canadian dollar capital program with cash flow, which is enough money to deliver double-digit output growth by the fourth quarter when compared to last year's fourth-quarter.

Resolute Petroleum also rebounded sharply this week following the release of its fourth-quarter results. Initially, the shale driller's stock plunged because it reported a deeper-than-expected loss. However, as investors dug into the numbers and news, they saw reasons for optimism. One cause for positivity was the company's decision to explore the sale of its Aneth Field, which could provide Resolute with a meaningful amount of cash to accelerate drilling or to finance its recent Delaware Basin acquisition. That has the potential to solidify the company's finances so that it can deliver significant production and cash-flow growth in future years.

Now what

All five of these companies struggled mightily during the long oil market downturn, and there were concerns that each might go bankrupt. However, those bankruptcy fears have faded away at Resolute, Penn West, and Abraxas because each has shored up its balance sheet and is now in the position to grow production thanks to their low-cost shale acreage. Unfortunately, Seadrill and Seadrill Partners are still on shaky ground because they haven't yet found solutions to their balance sheet problems, nor has the offshore drilling market started turning around. Because of that, investors are better off steering clear of those two stocks for now.

Matt DiLallo owns shares of Seadrill. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.