Stocks ended a losing week on a positive note Friday, with the Dow Jones Industrial Average (DJINDICES:^DJI) snapping an eight-day losing streak and the S&P 500 (SNPINDEX:^GSPC) closing with a small gain.

Today's stock market

Index Percentage Change Point Change
Dow 0.49% 119.19
S&P 500 0.19% 5.12

Data source: Yahoo! Finance.

Energy led the market, with the Energy Select Sector SPDR ETF (NYSEMKT:XLE) rising 2%. Banks were laggards today; the SPDR S&P Regional Banking ETF (NYSEMKT:KRE) lost 1%.

As for individual stocks, CarMax (NYSE:KMX) popped after beating earnings expectations, and Red Hat (NYSE:RHT) tanked following weak guidance for the current quarter.

Stock graphs, stock prices, and a pile of coins.

Image source: Getty Images.

CarMax beats expectations

Used-car dealer CarMax reported fiscal first-quarter revenue and earnings that exceeded expectations and shares jumped 12.9%. Revenue increased 5.5% to $4.79 billion, well above the analyst consensus estimate of $4.61 billion. Net earnings per share jumped 17.7% to $1.33, compared with expectations for 9.7% growth.

Comparable-store unit sales fell 2.3% from the period a year earlier, which is an improvement from the 8% decline last quarter. The average selling price of used vehicles increased 3% and the number of stores grew 10%, resulting in a net 4.6% increase in used vehicle sales on 1.6% more units. Wholesale unit sales jumped 9.6% and income from CarMax Auto Finance grew 5.7%.

A decrease in the company's tax rate to 25.3% from 37.4% accounted for almost the entire 12.7% gain in net income, but the growth in EPS also was helped by a 4% decrease in the shares outstanding, thanks to the company's aggressive buyback program.

CarMax is still dealing with decreased traffic and a slowdown in the used vehicle market that is creating tough comparisons with strong performance last year. Investors today were impressed that the company is managing to generate growth despite the challenges.

Red Hat stirs up some short-term worry

Shares of Red Hat sank 14.2% today after the cloud software provider reported fiscal first-quarter results that beat expectations, but followed with disappointing guidance for the current quarter. Revenue increased 20% to $814 million and adjusted earnings per share popped 24% to $0.72. Analysts were expecting EPS of $0.69 on revenue of $808 million. Causing consternation among investors was the company's guidance for Q2 revenue between $822 million and $830 million, compared with the analyst consensus of $854 million, and adjusted EPS of $0.81, well below the expected $0.89.

Subscription revenue from infrastructure-related software, the company's largest segment, grew 11% in constant currency to $522 million and subscription revenue from application development and other emerging technology offerings for the quarter grew 32% excluding currency effects. Both subscription growth numbers represented slowdowns from last quarter. On the conference call, Red Hat admitted that its core middleware business "has slowed a bit."

Cash flow remains strong, though, with operating cash flow growing 34% from the period a year earlier. The company announced a new authorization for $1 billion in share buybacks.

Despite the disappointing forecast for the next quarter, Red Hat raised its full-year guidance for adjusted EPS by 1.9%, while cutting revenue guidance by $50 million, "solely to account for the change in FX rates," according to CFO Eric Shander.

Red Hat investors have high expectations for growth from the provider of open-source tools to help companies migrate systems to the cloud, and those expectations for the very near term may have gotten a bit ahead of reality.

Jim Crumly owns shares of Red Hat. The Motley Fool owns shares of and recommends CarMax. The Motley Fool has a disclosure policy.