carmax is great and typically sells decent used cars. they do have firm, and in my opinion high, pricing. don't expect a deal if thats your first goal in the process.
buying a brand new car in any economy is an absolute waste of money. lets face it, the only reason to buy a new car is to buy a new car. We all love the feeling and the new car odor. You lose thousands in value as soon as you sign the paper and turn the key. Let the market absorb that and get a low mileage used car. The warranty will be intact, you'll spend a fair bit less, and not end up as upside down as you normally would. And you'll still have a nice newer vehicle.
don't get caught up in resale value, projected trade values and investment quality. frankly all of that is semantic bulls*** used by the ad agencies to sell brand new cars of that marque. you need to buy the car that is right for you, the car that you enjoy. who cares if you can weasel a $1000 more from some poor sap for a camry versus a mazda6 five years down the line. if during those five years you weren't enjoying the car or it just plain wasn't right for you, then honestly none of that matters.
its real simple. buy a car you're going to enjoy. buy a car that isn't going to bankrupt you. buy a car that makes sense for your needs. and don't buy a car with the mentality that you'll be buying something new in five years. get a car thats going to last, pay it off and drive it into the earth. which honestly renders a lease irrelevant.