"First AutoZone and O'Reilly bounced from their lows over the summer, then Advance Auto Parts seemed to bottom last month. It's now up 28 percent from its lows on Nov. 8," the "Mad Money" host said. "That's a magnificent move. More important, if the auto parts business is really back on track, then these stocks are dirt-cheap in a market where we're constantly hearing people fretting about sky-high valuations."
All three stocks served shareholders well from 2013 to 2016, when people were less eager to buy new cars following the financial crisis and, as a result, had to replace car parts more often.
But starting in 2017, all three fell off a cliff. The proximate cause? Amazon's rumored foray into the auto parts industry.
In late January, Wall Street started buzzing about the e-commerce giant's potential disruption in auto parts, and shares of O'Reilly, Advance Auto and Autozone all got slammed.
Shortly after, auto parts retailers started issuing dismal earnings reports. Even though the weakness had nothing to do with Amazon, it looked bad given the worries about potential competition.
In February, Advance Auto and AutoZone both reported shortfalls. O'Reilly's results, usually the strongest of the three, still beat estimates.
By spring, all three were struggling: Advance Auto's earnings missed expectations by far, with same-store sales were down 2.7 percent; AutoZone reported a gigantic miss; and O'Reilly disappointed analysts despite giving decent guidance.
"So what caused these hideous numbers? The one thing that all three companies kept citing as an alibi for their poor performance was the very mild winter, [the] second mild one in a row," Cramer said.
Cold winters tend to raise the need for car maintenance and part replacement, so mild winters result in less overall demand for replacement car parts.
Last year's mild winter also resulted in dramatic sell-offs for the car parts plays. Advance Auto slid from $169 a share at the beginning of 2017 to $78 a share when it bottomed a month ago; AutoZone fell from $789 to $491 at its July lows; O'Reilly tumbled from $278 to $169.
But come fall, all three stocks started gaining strength. Advance Auto gave Wall Street a big earnings beat and re-affirmed its full-year guidance; AutoZone delivered a strong quarter; and O'Reilly beat estimates and raised its full-year forecast.
"I think the market may have overreacted in the first half when these companies reported a wave of shortfalls and everyone was freaking out about 'Death Star' Amazon," Cramer said.
"I've even recommended Advance Auto Parts as a takeover target at the Deal Economy conference a couple weeks ago because Jeff Smith, who runs Starboard Value, the activist fund, is Advance Auto's chairman. I bet he'd love to get [a deal] out of this one," he added.
And all three stocks are still fairly cheap, Cramer said: Advance Auto trades at 17 times next year's earnings estimates, AutoZone at 14 times and O'Reilly at 19 times.
"The sell-off was a total rush to judgment," the "Mad Money" host concluded. "Which one should you buy? ... You can take your pick. You can buy best of breed, that's O'Reilly. You can bargain-hunt with AutoZone or you can speculate on a takeout with Advance Auto Parts. Boy, this industry, it's got something for everybody."