Finding a "cheap" stock isn't as simple as just screening for companies with a lower valuation than the market's. If that approach worked, then you could pick any stock with a price-to-earnings ratio below 24, which currently covers over half of the S&P 500.

A more targeted method -- that's also likely to yield better results -- is to compare stocks against peers in the industry and choose those that are cheap relative to competitors.

Using that approach, here are two companies that look like bargain buys for long-term investors.

Discount on aisle three

Kroger's (KR 0.34%) stock has dropped 5% over the last year but its P/E ratio has slumped by 17% over that same time, producing a solid discount for new investors. Wall Street isn't happy about a significant growth slowdown for the supermarket chain: Comparable-stores sales gains fell to 2% in Q1 from 4% the prior quarter and 5% before that.

Source: Kroger financial filings.

Yet Kroger is still expanding faster than peers Wal-Mart (WMT -0.30%) and Whole Foods (WFM), which recently posted 1% and -3% comps, respectively. The stock looks like a good value at 16 times earnings, matching Wal-Mart's premium and well below Whole Foods' 20 P/E. Unlike its more focused competitors, Kroger's flexible pricing and marketing strategies allow it to appeal to both value-conscious shoppers and those in the mood for a more premium food experience.

Deflationary pricing pressures are likely to make Kroger's comps look tiny compared to last year's 6% boost. That's true for the entire industry, though. Meanwhile the retailer is poaching market share from rivals (as it has for 10 years running) and is on track to produce double-digit profit gains yet again in 2016. Long-term shareholders can also look forward to a growing contribution from online ordering along with several other big initiatives in the works including the expansion of its Simple Truth brand into new categories. As CEO Rodney McMullen likes to tell investors, Kroger's "to do list remains longer than its done list."

Cool, refreshing valuation

It's been years since investors could snap up shares of Boston Beer (SAM 1.03%) for a discount against industry titans Anheuser Busch (BUD 0.61%) and Molson Coors (TAP 0.63%). But thanks to spiking competition that's sent the stock lower, the craft beer specialist is now valued at just two times sales, compared to 5 times for each of its biggest competitors. Boston Beer had a similarly premium valuation as recently as early 2015.

Image source: Getty Images.

Boston Beer's volume is projected to fall slightly this year, keeping it just on pace with its bigger rivals. It had beat competitors by posting a 4% uptick last year and trounced the market with a 22% spike in 2014. Profits will also be pressured in 2016, since CEO Jim Koch and his team plan to ramp up investments in beer development and in marketing spending to support its core and recently launched brands.

Boston Beer has made it through rough patches like these before, though, mainly by innovating new brands like Angry Orchard. It has also made fundamental improvements to its supply chain with its freshest beer program that minimizes the amount of time between bottling and consumption. That strong track record of innovation is one reason why investors who believe the recent sales funk will pass could have a great buy on their hands in a company that's only responsible for 1% of the market's beer volume today.