What: Shares of Atwood Oceanics (ATW) are surging, up more than 30% by 11:15 a.m. EST on Friday. Fueling those big gains was the company's surprisingly resilient earnings.

So what: While Atwood's fiscal second quarter revenue slumped 15.4% year over year to $296.4 million, that was to be expected due to idled rigs and lower dayrates. What wasn't expected was to see the company's profitability stay afloat with earnings per share of $1.89 matching last year's result. It was a surprisingly strong showing, driven by a combination of cost cutting and debt repurchases.

On the cost side, Atwood Oceanics drilling costs fell across all three of its asset classes, with ultra-deepwater costs slumping 20.6%, even as revenue from those vessels climbed 3.3%, meanwhile drilling costs within its deepwater and jackup fleets were down 40.6% and 36.7%, respectively, from the year-ago quarter. Further, general and administrative costs sank 22% year over year.

In addition to this Atwood Oceanics took advantage of the volatility in the credit markets during the quarter to repurchase $13.4 million in principal of its senior notes for just $5.1 million, which is a 62.2% discount. In doing so the company recognized a gain of $8.4 million, which boosted its earnings by $0.13 per share this quarter. It also stated that those repurchases continued in April, with the company taking out another $140.7 million in principal for $94 million, which is a 34.8% discount.

It's worth pointing out that Atwood was much more successful in reducing debt than rival Noble (NEBLQ). Earlier this year Noble announced a tender offer for some of its existing debt, offering $200 million to retire upwards of $300 million in principal. However, only $36 million of Noble's senior notes were tendered. The big difference was that Atwood repurchased its debt on the open market where investors were selling it in a panic, while Noble went straight to current holders, which were not in panic mode and thus largely unwilling to part with their notes.

Now what: Atwood Oceanincs made solid progress during the quarter on two key concerns by lowering its costs and its outstanding debt. That said, the company still faces a number of expiring contracts later this year, which will likely cause both revenue and earnings to sink. Because of that, there will likely be continued choppy seas for this stock until the bulk of those vessels are under new contracts, which given the current state of the offshore drilling market could be quite some time.