When you look to the automotive industry for stocks to buy, it's easy to limit yourself to the major names like Ford, Toyota, or General Motors. But the industry has so much more to offer than just major automakers; here's one great stock you probably never thought of investing in, and another you should think twice about.

The race is on

Ironically, one of the most intriguing investments in the automotive industry was recently spun off from one of the least enticing automakers. Perhaps you recall Fiat Chrysler Automobiles spinning off Ferrari N.V. (NYSE:RACE) early last year. You might not know, though, that Ferrari's stock has been on fire over the past year.

RACE Chart

RACE data by YCharts.

It sounds crazy that an automaker that sold only 8,014 units last year could be one of the best investments in the industry. But that's just the point: At a time when most automakers are trading with unrespectable single-digit price-to-earnings ratios due to plateauing sales in the U.S., investing in an automaker that doesn't want to sell too many cars is brilliant. Exclusivity is important for Ferrari, so it plans to grow its sales consistently and methodically to preserve its brand image and premium price points -- and it's working really well. Consider that its adjusted-EBITDA margin during 2016 reached an enticing 28.3% -- 30% excluding foreign exchange hedges -- which is unheard of in the auto industry.

But Ferrari's uniqueness as a stock doesn't stop there, because this is a very rare opportunity for auto investors to own a pure ultra-luxury play. Sure, some automakers have phenomenal luxury lineups, but mainstream and less-profitable vehicles also contribute to their results. Some European automakers such as BMW offer something close, but nothing is quite like Ferrari. That ultra-luxury brand image should help maintain demand even during bumpy economic patches. 

A red LaFerrari supercar.

Image source: Ferrari.

The trick for Ferrari is to find the balance of sustainable and profitable growth for investors, while not diluting its brand. CEO Sergio Marchionne has hinted that Ferrari could easily grow its annual sales figures to 10,000 annually without damaging the brand, and as more consumers in China develop wealth, this could open up a lucrative opportunity to expand its top line even higher.

The only downside to Ferrari's stock right now is that after doubling over the past year, it trades at a pricey 33 times its trailing-12-month earnings. But at a time when investors are selling stock in major automakers because the companies can't seem to sell more vehicles, buying an automaker that doesn't want to sell more vehicles could be a savvy move.

Good company, bad scenario

While Ferrari deals in the super-premium market of new-vehicle sales, CarMax Inc. (NYSE:KMX) is nearly on the flip side of that scenario: It sells, finances, and services used and new cars (mostly used) through a chain of roughly 175 retail stores.

The company has a lot going for it: It's increased its sales and profitability at a solid rate and rewarded shareholders with a consistently increasing stock price over the years. It also operates with scale in a highly fractured industry, giving it cost advantages as well as pricing information few competitors can replicate -- thus it's able to find the right equilibrium on prices to optimize margins and turn over its inventory faster.

It's a good company, but here's the kicker: Used-car pricing headwinds are likely on the way. Looking at this graph, you can see that CarMax, the nation's largest used-car retailer, is already almost maxed out in terms of growing its average transaction prices.

Graph showing CarMax's average transaction prices peaking and recently declining.

Data source: CarMax quarterly presentations. Chart by author.

Unfortunately, consumers have offset increasing new-vehicle prices by extending loan lengths and opting to lease vehicles more often. The problem with the latter is that when those vehicles go off-lease, they're dumped onto the market in droves, which can quickly send used-car prices lower if market demand can't absorb the wave of vehicles. That's about to start happening at a more rapid rate in the coming years. But don't take it from me -- listen to John Murphy, analyst for Bank of America Merrill Lynch, as quoted in Automotive News:

If the industry is not large enough to absorb the 3.5 million units coming off lease this year, we may see significant pressure on used-vehicle pricing ensue this year in a very material way and spike down the cycle faster and more furiously than even we're expecting.

Even more sobering are the estimates that the number of units coming off lease could hit 5 million annually by 2021. How much will that wave of off-lease vehicles deteriorate used-car prices? It's hard to estimate, but in this National Auto Dealers Association Used Car Guide price graph, you can see that the impact is already being felt.

Graphic showing a significant decline for used car prices in 2017.

Image source: J.D. Power's NADA Used Car Guide Industry Update.

CarMax is a solid company, and it's grown value for shareholders over the past decade. However, used-car prices are likely to deteriorate over the next few years, and that could take a huge bite out of the company's top line -- and put pressure on its margins. If you're willing to buy and hold for a very long time, as you should, don't take CarMax off your watchlist, but understand that it faces serious headwinds in the near term.