The stock market continued to do well on Thursday, with the S&P 500 (SNPINDEX:^GSPC) and Nasdaq Composite (NASDAQINDEX:^IXIC) rising to record levels, yet again. Even the Dow Jones Industrial Average (DJINDICES:^DJI) did well, although it failed to eclipse its high-water mark.

Index

Percentage Change

Point Change

Dow

+0.95%

+323

S&P 500

+0.58%

+25

Nasdaq Composite

+0.69%

+98

Data source: Yahoo! Finance.

One of the challenges involved with investing in stocks is that share prices don't always move in relation to the performance of their underlying businesses. That was the case on Thursday for drugstore giant Rite Aid (NYSE:RAD) and homebuilder KB Home (NYSE:KBH), as both reported strong financial results that nevertheless left shareholders wanting more.

Below, we'll look more closely to see why this phenomenon is happening more often in this bull market.

Rite Aid isn't healthy enough

Shares of Rite Aid finished lower by nearly 15% on Thursday. The move came despite what seemed to be encouraging news about the drugstore chain's first-quarter results.

Rite Aid's business looked strong. Revenue moved higher by 2.2% from year-ago levels, sustaining high levels even after a good performance in the year-earlier period. Adjusted net income multiplied more than tenfold year over year, producing adjusted earnings of $0.38 per share. Rite Aid got a good tailwind from administering COVID-19 vaccines, providing 4.7 million shots during the three-month period.

Yet investors seemed to focus on negative aspects of the report. Although the retail pharmacy segment saw sales rise 5.5%, front-end sales activity weakened significantly from the year-ago quarter. Moreover, pharmacy services revenue also fell, as Rite Aid lost a significant customer that resulted in fewer members covered under health plans for which the drugstore chain provides services.

The big question is whether Rite Aid's full year will look as bad as it currently fears. The company thinks that one-time positive impacts from the pandemic will essentially disappear and projected adjusted net losses of as much as $0.79 per share.

That's a lot different from expectations of sizable profits among those following the stock. Rite Aid will have to turn things around in order to keep shareholders satisfied with the progress the drugstore chain has made in recent years.

Workers building a home.

Image source: Getty Images.

Betting on housing

Elsewhere, KB Home shares fell almost 7%. The homebuilder benefited from favorable conditions in the housing market, but investors were hoping that the company would be able to squeeze even more from its efforts than it did.

KB Home's fiscal second-quarter numbers showed huge growth, even if it didn't live up to expectations. Revenue soared 58% from year-earlier levels. Earnings nearly tripled to $1.50 per share. KB Home delivered more than 3,500 homes during the quarter, up 40%, and average selling prices rose 13% to nearly $410,000.

Gross profit margin expanded, and lower overhead costs helped bolster the company's bottom line. By the end of the quarter, backlog had nearly doubled to over 10,000 homes worth an estimated $4.26 billion.

KB Home's emphasis on entry-level buyers has worked well, but some believe that rising mortgage rates could eventually start to squeeze that segment of the market. Rising inflation has created fears that the Federal Reserve will have to get aggressive about tightening its monetary policy, and if rates do go up, it could start to price some marginal borrowers out of the market.

Watch out for high expectations

Investors need to understand that even when a business does well, a stock can go down if expectations are even higher. In the long run, a strong business should translate to great stock performance. But from quarter to quarter, there's no guarantee you won't see disconnects like this.

Fortunately, when stock prices fall too much, they can present bargains to opportunistic investors.

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.