Honestly, if they're a close friend, buy an air mattress or let them crash on the couch. I've done it plenty of times when visiting someone who didn't have a guest bedroom or there were a bunch of us.
I agree on the car if you're really only using it for a trip or two a year. (Indeed, I wouldn't even consider owning a car in that case. I probably would if I were going away a couple weekends a month though.)
That works fine in your 20s but not in your 30s when your friends are shackled to highly dependent screeching children, or in your 50s when your friends start having shitty backs and can't crash on your couch or leaky air mattress anymore.
I agree on the car if you're really only using it for a trip or two a year. (Indeed, I wouldn't even consider owning a car in that case. I probably would if I were going away a couple weekends a month though.)