Defense stocks enjoyed impressive gains in 2017, with Raytheon (RTN), up 32%, and Northrop Grumman (NOC 0.79%), up 31.9%, two of the highest fliers. This year, however, has been a different story, with each company down about 4% year to date and down more than 10% since mid-April.

The reasons for the rally, including President Trump's commitment to boost defense spending and increasing tensions with North Korea and Russia, were sound. But the concern expressed of late that the stocks had gotten ahead of themselves also rings true. Government procurement is a long and complicated process, and even with budget increases that new money is likely to trickle into supplier coffers slowly.

Company

Market Cap

TTM Revenue

TTM P/E Ratio

TTM P/S Ratio

TTM Dividend Yield

Raytheon

$55.87B

$25.35B

28.01

2.20

1.64%

Northrop Grumman

$54.84B

$26.13B

26.24

2.10

1.31%

Data source: Yahoo! Finance. Data as of June 22. P/E = price-to-earnings. P/S = price-to-sales. TTM = trailing 12-month.

The world isn't getting any safer. For investors with a long-term time horizon, there is still ample reason to be interested in defense stocks. Here's a look at where Raytheon and Northrop stand today to determine which, if either, is the better buy.

Flying a narrow path

Northrop Grumman is a $26.13 billion-sales maker of planes, radars, sensors, and electronics used in a variety of different defense platforms, with the company recently adding a broad collection of launch and space assets with its $7.8 billion acquisition of Orbital ATK.

B-21 illustration

Artist's rendering of Northrop Grumman's B-21 bomber. Image source: Northrop Grumman.

The company in recent quarters has shown considerable discipline in deciding what contracts to pursue, making waves by pulling out of a number of competitions, including a few it was expected to win, claiming that the expected returns did not justify the new investment.

The projects that remain tend to be in areas of Pentagon focus. Northrop's crown jewel is its planned B-21 bomber, a platform it won over competing bids from Boeing and Lockheed Martin that should generate more than $80 billion in revenue over its lifespan. Northrop Grumman is also a leader in drone technology, manufacturing the Global Hawk and Triton systems.

Northrop also has a large IT business, managing technology and systems for a range of federal, defense, state, and international customers. That's an area primed for growth over the next 12 to 18 months thanks to the two-year federal budget deal that freed up extra money for agencies to invest in modernizing tech systems.

International powerhouse

Raytheon, similarly sized to Northrop in terms of revenue, owns a commanding presence in areas of particular interest to the Pentagon, including precision weapons, anti-missile systems, and sensors and radars. Its sensor business has been the winner in some of the competitions that Northrop has walked away from, notably a recent award to supply a high-tech camera system for Lockheed Martin's F-35 fighter.

SM-3 interceptor launch

Artist's rendering of a Raytheon SM-3 interceptor launch. Image source: Raytheon.

The company is also the most diverse U.S. prime contractor in terms of international sales, with foreign customers accounting for about one-third of total revenue and more than 40% of its backlog. Raytheon's Patriot missile systems are deployed across the Middle East and in a growing number of European countries.

The future of that international revenue has been a reason for some of the recent investor concern, with tough talk on tariffs and the prospect of a trade war with some of the U.S.' closest allies raising fears that foreign governments would look to rebuild their own defense capabilities instead of buying from U.S. contractors. In an interview with CNBC June 20, Raytheon CEO Thomas Kennedy downplayed those fears, saying governments will continue to buy the best systems available regardless of trade tensions.

"The reason why these countries are buying our products is to protect their sovereignty and the freedom of their citizens," Kennedy said, adding that over time he wants international to grow to 50% of total sales.

In the meantime, the U.S. appetite for Raytheon products remains strong, with Kennedy saying the company's outlook is "the best we've seen for a long time."

The better buy is elsewhere

These are two strong, well-managed companies that are safe components of any long-term industrials portfolio, and investors with current positions in either Raytheon or Northrop Grumman should be in no hurry to sell. But even after the recent sell-off, both companies are still up more than 90% over the past three years, and both continue to trade well above historical averages in terms of valuation.

NOC Chart

NOC and RTN data by YCharts

For investors looking to put new money to work in a defense prime today, I'd recommend General Dynamics (GD 0.48%) over either Raytheon or Northrop Grumman. General Dynamics currently trades at a 20% discount to its rivals on a price-to-earnings basis and at a 13% discount on a price-to-sales basis due to continued weakness in its business jet division. There's more risk to General Dynamics, but there is also more potential upside should it get its aerospace business on track and close that valuation gap.

Should Raytheon in particular fall another 10% to 15% I'd give it a hard look, but defense stocks by their nature do not tend to have the rapid, dramatic upward movement that can validate buying near the highs in other sectors. Northrop and Raytheon are both great companies, but I can't justify buying into either one at these levels.