Hopes for a post-pandemic recovery have Wall Street in rally mode, with the S&P 500 hitting an all-time high in August. For existing investors it has been a great time to be in the markets, but what's a newcomer or someone with fresh capital to invest to do?

Stocks, by historical standards, are expensive, and popular sectors like tech look particularly pricey. It's easy to feel as though you have missed out on the gains, and to be reluctant to buy in at these levels. It's also not very appealing to buy into struggling companies just because their valuation is more reasonable.

But not every stock is overpriced, and not every company that has missed out on the rally is in trouble. There are still some stocks with reasonable valuations in certain sectors of the economy that have been largely overlooked by investors.

Here's why three Fool contributors believe Lockheed Martin (LMT 0.84%)Caterpillar (CAT 0.66%), and Cummins (CMI 2.54%) are relative bargains in a market where few stocks can be said to really be on sale.

An investor stares at a jar of coins.

Image source: Getty Images.

This defense titan offers a combination of value and growth

Lou Whiteman (Lockheed Martin): Imagine finding a company that has a $140 billion backlog of future business, is generating more than $1 billion in cash per quarter, and has a track record of returning that cash to shareholders. Now, imagine if that company traded at less than half of the S&P 500's average price-to-earnings ratio. Lockheed Martin is that company.

Lockheed Martin is the world's largest pure-play defense contractor, responsible for the F-35 Joint Strike Fighter, Sikorsky helicopters, missiles and missile defense, and electronics. The company also includes a space business that, at about $12 billion in annualized sales, has massive scale and reach advantages over red-hot space start-ups like Virgin Galactic Holdings that trade at much higher valuations.

Even among defense contractors Lockheed Martin is a relative bargain. The company today trades at 14 times earnings, a discount to General Dynamics' 17 times earnings multiple, and it's valued below Northrop Grumman in terms of a multiple of sales. 

Defense stocks have been under pressure over the past year due to concerns that the 2020 U.S. presidential election could put a crimp on Pentagon spending, but one need only turn on a news channel to be reminded the world is not getting any safer. And Lockheed Martin is an expert in areas such as super-fast hypersonic missiles and space tech that are poised for continued research and development investment even if the U.S. pulls back from active military operations.

Lockheed Martin in its most recent quarter generated $1.3 billion in cash from operations, and via share repurchases and dividends was able to return 129% of free cash flow to shareholders. Investors buying in today get a dividend yield approaching 3% and the potential for substantial growth in years to come as some of the research currently going on at Lockheed's legendary Skunk Works facility in southern California is converted to new contracts. Buying into Lockheed Martin today gives investors a lot of ways to win.

This industrial giant makes value investors purr

Rich Smith (Caterpillar): "Cheap" seems to me a subjective term -- but we can still apply some objective standards to it and come up with a stock that's cheap­-er than average, right?

For example, it shouldn't be too hard to run a screen on finviz.com and find stocks that cost less than the pricey 35 P/E ratio that is the average of stocks listed on the S&P 500. To refine your search, try looking for companies growing earnings faster than the 14% per year that the S&P is expected to grow over the next five years, too. Finally, to sweeten the deal, consider looking for stocks that pay more than the market average dividend yield of 1.4%.    

And what do you come up with after you do all of this?

A Caterpillar material handler in action.

Image source: Caterpillar.

Caterpillar -- which just happens to be a very likely suspect to benefit from Congress' upcoming $1 trillion (or is it $4.5 trillion?) infrastructure plan.

You see, with its price-to-earnings ratio of just 26.3, Caterpillar costs about 25% less than the average S&P 500 stock. (It's even less expensive when valued on free cash flow, by the way -- just 20.8 times). Meanwhile, analysts polled by S&P Global Market Intelligence believe that Caterpillar is likely to grow its earnings 25% annually over the next five years as the global economy revives and money begins flowing into the great American infrastructure rebuild. With Caterpillar being one of the country's leading manufacturers of construction equipment, that seems a sound growth thesis to me.

And on top of all the above, Caterpillar stock pays a 2.1% dividend yield to its shareholders. Modest in absolute terms, that's nonetheless a 50% more generous dividend yield than the average 1.4% dividend payout on the S&P 500 -- and a lot better than the 0% yield you'll get from most tech stocks.

An engine maker for tomorrow's transportation needs

Rich Duprey (Cummins): Engine maker Cummins has failed to keep up with the gains made by the broad market index over the summer, so even though shares are up 5% year to date, its stock lags the S&P 500's 20% rise.

Much of the concern surrounding Cummins has been the computer chip shortage that has weighed down much of the automotive industry. While Cummins engines primarily help drive heavy trucks, not cars, it does provide Stellantis pickups with engines along with those for light commercial vehicles in several foreign markets.

The pandemic crushed Cummins' business last year and while it's beginning to rev up its growth engine once more, COVID-19 variants, supply chain backlogs, and the chip shortage continue to weigh on its performance.

Still, second-quarter revenue jumped 59% to $6.1 billion as the North American market sprang back to life with a 75% year-over-year gain. Chairman and CEO Tom Linebarger told investors, "Strong demand across many of our key markets drove continued sales growth in the second quarter, particularly in North America, and resulted in solid profitability," pointing to the $600 million in net income according to generally accepted accounting principles (GAAP) Cummins generated in the period.

Yet more than just your usual diesel truck engines, Cummins has become a leader in hydrogen fuel cell technology, and it recently partnered with oil giant Chevron to develop low-carbon fuel cell infrastructure for vehicles and industry. They will be exploring how to implement hydrogen capabilities at the oil giant's facilities, and Cummins highlighted it is also exploring development of a hydrogen-fueled internal combustion engine.

In that same vein, Cummins is building an electrolyzer plant in Spain to produce hydrogen and it is helping French railway manufacturer Alstom expand its hydrogen-powered Coradia iLint fuel cell passenger train to Poland.

At just 12 times earnings estimates, Cummins trades at a fraction of what its long-term earnings growth rate is forecast and 17 times the free cash flow it produces. The pandemic will pass, the supply lines will straighten themselves out, and the chip shortage will eventually disappear, leaving Cummins back on the road to greater growth.