Let's face it: Most stocks are expensive right now. The cyclically adjusted price-to-earnings ratio (or CAPE ratio) popularized by economist Robert Shiller is at its highest level since 2000. There aren't many stocks trading at a discount these days.

But there are still a few stocks with attractive valuations and solid prospects. Here are three bargain stocks to buy with the market near all-time highs.

Tiny shopping cart with cash in it on a man's outstretched palm

Image source: Getty Images.

AbbVie

AbbVie (NYSE:ABBV) currently trades at only 8.7 times expected earnings. By comparison, the forward earnings multiple for the S&P 500 index (of which AbbVie is a member) is over 22. Healthcare stocks in the S&P 500 have an average forward P/E ratio of 16.3.

Why is AbbVie so cheap? The company's top-selling product loses U.S. patent exclusivity in less than two years. That product, autoimmune disease drug Humira, generated more than 40% of AbbVie's total revenue in 2020. 

Don't think that the stock is a value trap, though. AbbVie has a strong lineup of relatively new drugs with fast-rising sales. While the company acknowledges that its total revenue will dip in 2023, it expects to return to modest growth in 2024 and generate robust growth throughout the rest of the decade.

In addition to its solid long-term growth prospects, AbbVie also offers one of the most attractive dividends around, currently yielding 4.7%. Future payout hikes are likely as well. AbbVie ranks as a Dividend Aristocrat with 49 consecutive years of dividend increases. The drugmaker will definitely make it a priority to keep that track record going.

Bristol Myers Squibb

AbbVie isn't the only attractively valued big pharma. Shares of Bristol Myers Squibb (NYSE:BMY) also trade at 8.7 times expected earnings. 

Bristol Myers has another thing in common with AbbVie: Its top-selling drug loses U.S. patent exclusivity soon. In this case, blood cancer drug Revlimid faces generic competition starting in early 2022. But these generic rivals will only be available in limited volumes at first. Those volume limitations will fall by the wayside in 2026.

But Bristol Myers' lineup features several drugs that should help offset the anticipated lost revenue for Revlimid. These include blood thinner Eliquis; newly approved cancer cell therapy Breyanzi (liso-cel); and Zeposia, which is currently approved for treating multiple sclerosis and could soon win another approval for treating ulcerative colitis. The company's pipeline also includes several potential blockbusters such as cell therapy ide-cel and mavacamten, a chronic heart disease drug picked up with the recent acquisition of MyoKardia.

Warren Buffett gave Bristol Myers a big vote of confidence in the fourth quarter of 2020. It was one of three big pharma stocks that Buffett's Berkshire Hathaway bought in the quarter. AbbVie was one of the other two stocks.

Tronox Holdings

Bargains aren't just limited to the healthcare sector. Shares of chemical maker Tronox Holdings (NYSE:TROX) also look pretty cheap right now. The stock trades at three times trailing-12-month earnings and 13.2 times expected earnings. 

Tronox ranks as the world's leading vertically integrated manufacturer of titanium dioxide pigment, which is used in lots of products, including paints, paper, and plastics.

The chemical stock has been a big winner so far in 2021 with its shares up more than 35% year to date. This impressive gain is due in large part to the housing boom in the U.S., with demand for paint products that use titanium dioxide skyrocketing.  

Tronox could also benefit as the global economy recovers from the pandemic. Increased sales of consumer products should drive increased demand for titanium dioxide. This bargain stock might not be such a bargain for too much longer.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.