For defense contractors, all roads lead to, and most revenues come from, the Pentagon. Image source: Getty Images.

After broadly falling for five straight years, the U.S. defense budget finally ticked up a bit in fiscal 2016, rising to $585 billion. Now, Congress is contemplating an additional increase in 2017.

Military spending is already set to hit $602 billion based on the latest version of the 2017 National Defense Authorization Act, a level that the Senate signed off on last month. That number differs from the $583 billion approved by the House in April, however, and the two chambers have yet to agree on a final figure to send to the President for signing by their September 30 deadline.

For military contractors such as Kratos Defense & Security Solutions (KTOS -2.76%) and Leidos (LDOS 0.76%), the likely increase in defense spending is great news. But it still leaves us with two questions: Which defense contractors will reap the lion's share of the extra money? And most pertinently, which is the better stock to buy?

Let's take a look.

Kratos Defense & Security

Priced at more than 19.3 times trailing earnings today, with no free cash flow, no dividend, and $424 million net debt on the balance sheet, Kratos Defense stock doesn't look like much of a value at first glance. And the second glance isn't much better.

From one perspective, Kratos stock appears to be undervalued. Its price-to-sales ratio is a mere 0.4, which is far below the "one times sales" valuation that's historically prevailed in the defense industry. Problem is, Kratos doesn't earn a lot of profit on its sales. Up until last year, it had produced four straight years of negative earnings. And going forward, long-term growth-rate projections for Kratos average 3% annually, according to analysts polled on S&P Global Market Intelligence. That gives the stock a PEG ratio of 6.4 based on trailing results.

Leidos

The situation at Leidos, a much larger, IT-focused defense contractor, is quite different. Thirteen times Kratos's size with its $3.6 billion market cap, Leidos usually does a much-better job translating its revenues into profits. With the exception of a big, writedown-related loss in 2015, Leidos has earned profits in each of the past five years. Average profit across the past five-year period is $138 million -- even counting the 2015 loss -- while trailing profit is twice that -- $272 million.

That works out to a trailing P/E ratio of 13 at Leidos -- much cheaper than at Kratos, and on a much-more consistently profitable company. Additionally, Leidos's profits appear to be of higher quality than what Kratos produces.

Free cash flow for the past 12 months amounted to $408 million over the past year -- 50% higher than reported net income. Valued on its free cash flow, the company sells for just an 8.7-times multiple to FCF (9.8 times, once debt is factored in to calculate an enterprise value).

An open-and-shut case

With analysts predicting that Leidos will grow earnings at about 10% annually over the next five years, the company's 8.7 times multiple to FCF suggests the stock is very cheap, indeed. Add in the company's respectable 2.6% dividend yield -- remember, Kratos pays no dividend -- and this is an open-and-shut case.

Leidos may not be the best-known name in defense. It may not be the "sexiest" military stock to own. But at today's prices, Leidos stock is a bargain. And it's a better buy than Kratos.