Defense contractor Northrop Grumman's (NOC -1.56%) most important program is coming in way over budget, and investors are throwing up the white flag. Shares of Northrop Grumman traded down 7% as of 11 a.m. ET Thursday after the company reported a fourth-quarter loss and provided a gloomy outlook for its brand new bomber.

An earnings bomb on higher B-21 costs

Northrop Grumman is one of then nation's largest defense contractors and is the prime contractor for two-thirds of the U.S.'s planned nuclear triad refresh, which is considered a top government priority. Northrop has been tasked with developing a new bomber and new missile designed to act as a deterrent against a potential nuclear attack.

But the company's recent results leave a lot to be desired. Northrop recorded a fourth-quarter loss of $1.45 per share, significantly below Wall Street's expectations for a $5.80-per-share profit. The primary culprit was a $1.56 billion charge taken against the B-21 Raider bomber it is building for the U.S. Air Force, a reflection of spiraling costs since the contract was awarded back in 2015.

Northrop warned it is likely to lose money on the first five batches of aircraft delivered under the fixed-price deal, which capped the price per plane at about $700 million. Even without the charge, results were middling, with the company benefiting from lower interest and corporate charges that offset weakness in its space and mission systems units.

The company guided for earnings per share of between $24.45 and $24.85 in 2024 with an operating margin of about 11%. That's roughly in line with what analysts had expected. Northrop's book-to-bill ratio, a measure of future business booked relative to what was billed out in the quarter, was a solid 1.02, but it did trail rival Lockheed Martin's 1.24 book-to-bill ratio for the quarter.

Is Northrop Grumman a buy after its big fourth-quarter charge?

It's worth noting that Northrop has been talking about potential charges on the bomber program for about two years, so the charge was not a complete surprise. But some investors had hoped the Pentagon would be willing to reopen the contract or absorb some of the cost overage, which appears will not happen.

Defense investors need to be focused on the long term, because these massive programs tend to take years to work out. It is worth noting that even with Northrop expecting the B-21 to weigh on cash generation through 2026 the company still expects free-cash-flow growth of 15% or more annually in the coming years, meaning plenty of cash will be available for stock repurchases and to fund the dividend currently yielding about 1.7%.

Northrop Grumman shares have largely tracked the market's performance over the past five years, and that is likely to be the general path for the stock in 2024 as well.

There's no reason for current Northrop investors to panic, but there are also better opportunities in the defense sector right now. Investors can afford to be patient if considering putting new money to work in Northrop Grumman.