Upvote:3
You would probably take CA-1 from SF all the way down to Los Angeles. I'm not sure if you can just sleep on the beach, but there are towns with motels along the way. You can probably find a place to stay in Monterey, San Louis Obispo and Santa Barbara along the way. There are also camping sites in Big Sur.
From Los Angeles to San Diego its all urbanized/militarized, and lodging shouldn't be a problem. You can take CA-1 along the coast (but its in fact a bunch of streets), or you can take the I-5/I-405 and exit in various places (Huntington Beach, Newport Beach, Laguna Beach, Carlsbad etc).