In a boom-and-bust business like oil, a company must be nimble to survive.

Companies that grew quickly thanks to the shale boom are trying to weather the dramatic slide in oil prices with measures like scaling back production and laying off workers. But for many, sunk costs and high debt levels mean cutbacks are not enough.

As a result, defaults and bankruptcies are mounting in the U.S. energy industry as the price of crude bounces along under $30 a barrel amid a worldwide oil glut. And with some forecasts pointing to oil — already down more than 70% since mid-2014 — possibly falling below $20 a barrel, failures are expected to continue. What’s more, plummeting energy prices have been a large contributor to the huge slide in global stock markets now underway.

But while there’s plenty of pain to go around, for stronger energy companies, the shakeup may provide a salve in the form of a chance to pick up some strategic assets on the cheap.

“Even bad times provide some opportunity,” says Lawrence Hrebiniak, a Wharton emeritus professor of management.

A Fast Slide

After recovering from a sharp fall during the global economic crisis, benchmark oil prices reached the mid-$80s by late 2010. In February 2011, another spike sent crude back over $100 a barrel, where it would largely stay for the next three-and-a-half years.

The boom encouraged more companies to invest, often using borrowed money.

By some estimates, the world is producing as much as 2 million barrels more per day than it can consume.

Then the unraveling started 18 months ago. The price of a barrel of crude fell from over $114 in June 2014 to $49 in January 2015. In a brief reprieve, prices then went back over $65, but in May, the declines resumed and the slide has accelerated since the start of 2016. Benchmark prices fell below $30 a barrel last week for the first time in 12 years, according to Bloomberg Business. Brent crude, the international benchmark, settled at $27.99 on Tuesday.

Several factors are driving prices down, but the main issue is oversupply. There’s simply more oil on the market than anyone needs, especially given the economic slowdown in China and emerging markets. OPEC nations, reluctant to give up market share, have abandoned their traditional role regulating supply, and instead are maintaining high production levels. By some estimates, the world is producing as much as 2 million barrels more per day than it can consume, says Wharton finance professor Erik Gilje.

One reason for that was unexpected success, Gilje explains. In mid-2014, it became clear that the technology used to extract shale oil was even better than anticipated. Wells were twice as prolific as expected, even in older drilling areas. Where the markets expected overall North American supply would grow by about 1 million barrels per day, “it actually reached 1.8 million,” he says. That caught many by surprise, in part because of the difficulty tracking production. “Real time consumption and production figures are incredibly opaque,” Gilje explains, noting that data may be revised up to 12 months later. “It’s hard to know what’s happening.”

Complicating decision making for producers: The predictive markets were wrong. “You can go back to September 2014 and basically look at what the futures curve looked like for oil,” he says. “Everyone expected it would be at $90-a-barrel-plus out to the future.

“If I’m a U.S. shale company, I go back to 2014 and I see the financial markets are telling me I’m going to have $90 a barrel forever,” Gilje adds. “It’s perfectly rational for me to drill.”

To make matters worse, Iran announced this week it is re-entering the market after sanctions were lifted following its landmark nuclear deal with world powers. That means supplies will be even greater, one of the reasons many analysts predict even lower prices to come.

The Fallout

The rout already has taken a heavy toll, especially among smaller companies. According to Texas-based law firm Haynes and Boone, 42 U.S. energy companies in debt for more than $17 billion went bankrupt last year.

“There’s probably quite a few more on the fence,” says Hrebiniak. Bond default rates are also rising, he notes. “There are some companies whose credit ratings are going to be dropped drastically.” That will make it more difficult and expensive for the companies that survive to borrow in the future.

And there’s reason to believe the shakeout will continue. A report from consultant AlixPartners said the projected revenues of 134 North America-based exploration and production companies show there could be a gap of $102 billion against their operating and capital expenditures in 2016.

“Shareholders have to understand they might miss a dividend or two, but that’s better than going out of business.” –Lawrence Hrebiniak

In a move reminiscent of the housing bust, the four biggest U.S. banks — Bank of America, Citigroup, JPMorgan Chase and Wells Fargo — have set aside at least $2.5 billion combined to cover souring energy loans, Bloomberg reported. All four are prepared to boost their reserves even more if oil prices stay low.

One step some public companies have already taken is reducing dividends and cutting share buyback programs. “Shareholders have to understand they might miss a dividend or two, but that’s better than going out of business,” Hrebiniak says.

The industry is also following other steps in Hrebiniak’s prescription for survival. It has already cut more than 200,000 jobs in the past 18 months, according to AlixPartners. Companies have also renegotiated contracts with suppliers and dropped capital spending by 20% to 40%. “Drilling activity in the United States declined by more than 50% in the past 12 months,” the AlixPartners report stated.

The firm said that those actions helped some companies lower their break-even costs across active oil fields by 30% or more, which should help relieve some of the financial pressure this year. “Those measures should serve as a roadmap for other players that face continuing challenges,” the report said.

And it’s not just small U.S. companies cutting back in response. In September, Royal Dutch Shell said it would end its controversial drilling program in the Alaskan Arctic and cut 7,500 jobs. BP said last week it will eliminate 4,000 jobs worldwide.

“Projects all around the world are being cancelled or postponed,” Gilje says. “If you’re in a position to be responsive here, you basically are going to cut back everything that you can in terms of investment.”

Oil companies should also be looking to their lenders for some relief, according to Hrebiniak. “Even though banks have cut bank lending, they know the industry,” he says. Companies may be able to renegotiate loans for better terms. “If the past is any indication, the bust will turn, slowly, but into a more positive position for the industry.”

M&A Pickup in Store?

Already, several companies have combined as they try to squeeze out savings by reducing duplicate operations.

“I think the bigger companies are going to be more interested in asset accumulation than investment in alternative sources of energy right now.” –Lawrence Hrebiniak

“We expect the paces of those types of activities to pick up in 2016 because current industry dynamics appear geared to a lengthier slump than previous cycles lasted,” the AlixPartners report said.

Companies that don’t want to sell outright can also look to strategic alliances that can help reduce costs without giving up their best assets, Hrebiniak suggests.

One logical step, selling non-core or underperforming assets, may become more challenging if low prices persist. Bloomberg reports that increasingly, bankrupt companies are having trouble pulling in even their minimum bids for the assets they’re selling. That’s an indication there’s plenty to choose from, which will drive prices down. “It’s a buyer’s market,” Hrebiniak notes.

Some of the larger firms might try moving into alternative energy as a way to hedge oil losses, but that strategy has its own challenges. “The problem is not only economic; the problem is also political,” Hrebiniak says. Given that alternative energy tax breaks and other subsidies can be an important part of the mix, Hrebiniak adds that “it depends on who’s in the Senate and the House and the White House.”

Plus, there may be more enticing opportunities for large investors. “I think the bigger companies are going to be more interested in asset accumulation than investment in alternative sources of energy right now,” Hrebiniak says.

Alternatives are also an unlikely course for the smaller companies hit hardest, due to the huge investment costs refocusing would require.

“Most of the companies are not in the position to simply shift to alternatives,” Gilje says. And alternatives face their own economic challenges as a result of the sharp drop in oil prices. “One of the side effects is that the day when solar and wind make up a big component of electric power is farther away. It’s hard when competing fuel prices are going down in price.”