Huntington Ingalls Industries, Inc. (HII -1.01%) is primarily a builder of military ships. That's a niche business but one in which it is a prime player. Lockheed Martin Corporation (LMT 0.38%) is a far more diversified supplier to the U.S. government, giving it more levers to pull as it looks to grow. There's always a steady stream of business for these military contractors, since the need to defend our country will never end. But which of these companies is a better business -- and, equally important, is either worth the price Wall Street is asking?

Leaning toward diversification

When you step back and examine Huntington and Lockheed from a big-picture perspective, there's a pretty clear difference in their business models. Huntington does one thing (building ships) and does it very well. In fact, the U.S. Navy would have a hard time supporting its operations without the company. Being a "mission-critical" supplier is a good thing because it means a steady flow of business, with ships scheduled for delivery all the way out to at least 2022. And then there are the service contracts that go along with the ships it sells.   

A military drone flying at dusk with the sun setting behind it in the distance

Image source: Getty Images

This helps explain Huntington's slow and steady revenue growth since it was spun off from Northrop Grumman in early 2011. Earnings have been less consistent but were more than three times higher in 2017 than they were in 2012, the company's first full year as a stand-alone entity. Dividends, meanwhile, have increased each year since the separation. But with roughly 90% of revenues coming from largely just one branch of the military, Huntington's ability to grow is somewhat limited.     

Which is why Lockheed's business is more interesting from a big-picture perspective. Although aircraft and helicopters make up about 65% of the company's sales (combined), such flying machines are used by every branch of the military. Missiles (15% of revenue), meanwhile, are core tactical tools that are, for better or worse, consumables that must be replaced once used. And the company's exposure to space projects (around 20%) gives it access to an increasingly important military arena that impacts every military branch and the broader government as well.   

If you are looking for the broadest reach, Lockheed Martin is easily the better choice here. That said, the diversified company earned nearly seven times as much revenue as Huntington in 2017. With its fingers in so many pots and the scale difference, there's more that can go wrong. For example, winning government contracts is a very competitive activity that Lockheed has to complete on a regular basis. That helps explain why Lockheed's top line has been on a more jagged path as it has trended generally higher. Earnings have bounced around as well. If you can handle that volatility, however, the long benefit of the diversification afforded by Lockheed is probably worth the uncertainty over shorter time periods.     

LMT Revenue (Annual) Chart

LMT Revenue (Annual) data by YCharts.

The company's dividend, meanwhile, has increased annually for 15 years running. That provides investors with something to hold on to while they deal with the inherent ups and downs in Lockheed's generally growing business. The stock's 2.5% yield is also nearly twice the 1.3% offered by Huntington's shares, giving it a clear edge for income investors as well.   

But what about valuation?

A great stock, however, isn't always a great investment. Which is why you also need to look at valuation. Lockheed Martin's forward price-to-earnings ratio based on consensus analyst estimates is currently just under 19. That's not bad, considering the company's trailing five-year average P/E is around 21.5. However, Huntington's forward P/E is 14 compared to a trailing five-year P/E of roughly 18. Lockheed's P/E is about 12% lower than its historical trend, while Huntington's P/E is about 22% lower.     

LMT PE Ratio (TTM) Chart

LMT PE Ratio (TTM) data by YCharts.

Suddenly Huntington looks like a better deal. But we're not quite done yet. Lockheed's P/E ratio has been distorted recently by one-time charges related to the recent tax cuts, leading to a disastrously high trailing P/E of 37! That pushes its trailing average higher. Its trailing five-year median P/E is around 18 -- that's actually lower than the forward P/E and makes Lockheed look relatively expensive today compared to its own history. Huntington's five-year trailing median P/E is around 17, which means it still looks relatively cheap (though a little less so).   

Wait for a better price

While there's nothing wrong with Huntington Ingalls, I have big-picture concerns about its shipbuilding focus. It's a slow and steady operation, but buying what is, essentially, a one-trick pony is something investors should think carefully about. So even though Huntington Ingalls it has the better valuation here, I wouldn't be interested in buying it.

My preference would be Lockheed Martin and its widely diversified business. Only Lockheed seems a bit expensive today when you adjust for the earnings impact of the tax cuts. I would prefer to wait for a better entry point. Which means, in the end, neither Huntington nor Lockheed looks like a buy today in my book.