Looks like the laws are different in each state, I have looked in CA yet
My state says they have to give you a vehicle:
Manufacturers must make their vehicles conform to the warranties in place. If a lemon cannot be fixed in a reasonable amount of time, you are entitled to receive a replacement vehicle and to drive your lemon until you receive the replacement.
You may choose instead to get a refund of the purchase price, less a reasonable amount for your use of the vehicle. If the manufacturer does not make the vehicle conform to the warranty, you might also be entitled to collect damages.
Lemon Laws by State - Lemon Law Attorneys at DMV.org: The DMV Made Simple
Thankfully I haven't had to deal with that...
(I make sure any lemons I purchase are used and without warranty)