Spirit Airlines stock is flying higher this morning on better-than-expected results. Image source: Benjamin Beyers for The Motley Fool. 

Shares of Spirit Airlines (SAVE -1.95%) were up in pre-market trading as investors cheered better-than-expected second-quarter results. The stock has since lost ground and is down 1.74% as of 11:46 a.m. EDT. Here's a closer look at the Q2 totals versus Wall Street's projections:

SAVERevenueYear-Over-Year GrowthEarnings Per ShareYear-Over-Year Growth
Consensus estimate  $553.22 million  10.8%  $1.01  10.9%
Q2 actual  $553.42 million  10.8%  $1.03  13.2%
DIFFERENCE  $0.20 million  0%  $0.02  2.3%

Sources: S&P Capital IQ and Spirit Airlines press release. 

Commenting on the results, CEO Ben Baldanza said in a press release:

Our second quarter 2015 performance was negatively affected by an unusual number of storms and I want to thank our team members and business partners for their hard work and dedication in serving our customers and helping us to restore our operations to normal. In addition to an unusual number of storms, we've recently seen a noticeable change in competitive pricing behavior. But, the fundamentals of our business haven't changed: we continue to grow our network while maintaining high margins, delivering strong returns, and offering our customers low fares.

What went right: Gross margin improved from 33% in last year's Q2 to 39.9% over the past three months as Spirit kept a lid on costs and optimized revenue while expanding. Specifically, the carrier added three new A320 aircraft and 24 new nonstop routes in the second quarter. A 17.4% drop in the price of fuel no doubt contributed to the gains.

What went wrong: Spirit didn't fill up its new routes as fast as investors expected. Available seat miles jumped 30.1% but revenue passenger miles -- the amount actually alloted for ferrying travelers -- rose 27.8%. Load factor dipped 1.5 percentage points.The good news? None of this had a meaningful impact on cash flow from operations, which has more than doubled year over year through the first six months of 2015. 

What's next: Spirit Airlines didn't include a third-quarter outlook in its press release. Nevertheless, analysts tracked by S&P Capital IQ have the company generating $580.88 million in revenue and $1.18 a share in profit after accounting for stock-based compensation and other noncash items. That compares with $519.80 million and $1.01 a share in last year's Q3.

Longer term, analysts have Spirit growing earnings by an average of 20.27% annually over the next three to five years. 

In the meantime, investors should pay close attention to the delta between revenue per available seat miile and cost per available seat mile as capacity increases and the fleet shifts. Maintaining a healthy gap as Spirit modernizes is key to sustainable profit.