In light of conflicts in the Middle East and Ukraine, one might assume that aerospace/defense giant Lockheed Martin (LMT 0.53%) would be a darling on Wall Street. Yet, Lockheed Martin stock gained little ground in 2024's first half.

Then July came around, and suddenly Lockheed Martin stock's trajectory went from horizontal to vertical. This raises the question of "Is it too late to invest?" and, just as importantly, "What sent the stock soaring?" As it turns out, Lockheed Martin's Street-beating results and optimistic outlook suggest that a sustained share-price rally may be in store.

The jets that didn't fly (yet)

It's not difficult to figure out why Lockheed Martin stock flew in July. The primary catalyst was the company's second-quarter report, which certainly had some positive highlights.

Lockheed Martin's deliveries of a well-known aircraft wasn't one of those highlights, though. The company delivered no F-35 combat jets in Q2 and, due to required fixes of technical issues, Lockheed Martin has had $10 billion worth of those jets sitting outside of a factory, yet to be delivered.

Of course, this doesn't mean the F-35s won't be delivered, and Lockheed Martin delivered other aircraft types during the second quarter. Rather than focus on recently delivered F-35s (or the lack thereof), forward-looking investors might take note of Lockheed Martin's Q2 order backlog of $158.34 billion, which isn't very different from the company's $160.57 billion backlog from the year-earlier quarter.

In any case, Lockheed Martin already started delivering updated TR-3 F-35 combat jets to the U.S. military and anticipates delivering 75 to 110 F-35 jets during 2024's second half. So, upcoming quarterly reports shouldn't have a goose egg in the column for F-35 deliveries.

A sunny outlook for dark times

Despite the lack of F-35 deliveries, international conflicts ensured that Lockheed Martin would still fare well in the second quarter of 2024. Large-scale Pentagon contracts for missiles to be sent to Ukraine helped Lockheed Martin grow its revenue by 9% year over year to $18.1 billion, beating Wall Street's call for $17 billion. Turning to the bottom-line results, Lockheed Martin earned $6.84 per share, thereby beating the analysts' consensus estimate of $6.46 per share and showing improvement over the $6.73 per share earned in the year-earlier quarter.

Perhaps most encouraging, Lockheed Martin raised its full-year 2024 financial guidance. Specifically, the company lifted its net sales outlook range from $68.5 billion to $70 billion previously to $70.5 billion to $71.5 billion currently. Additionally, Lockheed Martin hiked its 2024 earnings per share (EPS) guidance range from $25.65 to $26.35 previously to a currently expected range of $26.10 to $26.60.

With that, Lockheed Martin CEO Jim Taiclet maintained an optimistic tone and made sure to remind investors of Lockheed's "backlog of nearly $160 billion, greater than two times annual revenue." The subtext, no doubt, is that the fiscal figures should only get better for Lockheed Martin.

Whether Lockheed Martin actually meets its hiked full-year guidance remains to be seen. The winds of war can shift at any given moment, and so can Lockheed Martin's outlook for the back half of 2024.

Still, until proven otherwise, it looks like Lockheed Martin's future prospects are bright, or at least brighter than they were before. Therefore, it's not too late to pick up a few shares of Lockheed Martin stock with hopes of peace but expectations that nations won't resolve their disagreements anytime soon.