What happened

On Tuesday, stocks enjoyed their second straight day of gains as investors appear to see glimmers of hope that the worst of the rate hikes are now behind us and a so-called hard landing can be avoided. Airline stocks, which tend to perform poorly during a recession, are taking off on the thought that a downturn can be avoided.

Shares of American Airlines Group (AAL 6.60%) and Delta Air Lines (DAL 2.86%) are leading the way, each up more than 8% as of 11 a.m. ET on Tuesday, with shares of United Airlines Holdings (UAL 17.45%), Southwest Airlines (LUV 2.60%)Alaska Air Group (ALK 4.71%), and JetBlue Airways (JBLU 4.59%) all up more than 5% apiece.

So what

The recently concluded third quarter was a tough one for airline stocks, with the entire group listed above down between 31% and 38% due to growing fears about the potential for a recession. The Federal Reserve has made it clear it will not stop raising rates until it is confident that inflation is under control. By definition, the Fed's actions are trying to cool the economy. The fear among investors was that the cooling would go too far, causing the economy to stall.

Businesses and consumers tend to cut spending during a downturn, and airfares are an obvious place to target when trying to cut spending. Air travel is for the most part a discretionary purchase, or at least one that can be deferred when trying to deal with other costs or declining income.

In years past, once-storied names like TWA, Braniff, and Eastern disappeared from the skies during recessions.

We're not out of the woods yet, but markets have rallied in recent days on a couple of data points that could suggest the Fed will be cautious from here. A report out Monday showed U.S. manufacturing activity declined to its lowest level since May 2020, and overnight Australia's central bank slowed the pace of its rate hikes.

With growing pressure on central banks to avoid going too far, including a new report from the U.N. warning that hikes could result in a global recession and a period of prolonged stagnation, investors are hoping the Fed will take its foot off the gas in the quarters to come.

For airlines already trying to dig out from the damage done to their businesses from the pandemic and facing higher-than-expected labor costs, anything that reduces the risk of a recession would be welcome news.

JetBlue and American are also likely rallying based on the two airlines' passionate defense of their alliance in the face of regulatory criticism. The Justice Department has asked a federal judge to roll back the alliance, which it calls a "de facto merger" that hinders competition, but executives from American and JetBlue in testimony this week have made it clear they have no intention to back away from the partnership.

Now what

Sentiment is moving in the right direction, but investors need to be careful not to get ahead of themselves. For one, it is dangerous to try to predict what the Federal Reserve does from here. Secondly, even if a recession is avoided the airlines still face a lot of other headwinds on the horizon.

The industry took on massive amounts of debt during the pandemic, and have still not yet fully restored operations post-COVID. International and business travel, two of the more lucrative parts of the business prior to the pandemic, have been slow to recover, and by some estimates could take until late 2023 to normalize even if there is no recession.

For those willing to ride out the turbulence, Delta and Southwest have best-in-class management teams and should be able to recover well ahead of the pack. But be advised there is likely no reason for buyers to chase this week's rally: With so much uncertainty about the economy and the prospects of a slow recovery, expect the airline sector to remain volatile for the foreseeable future.