This is a non-scientific, personal survey based on experience.  Others please feel free to chime in!

A map of the hotels listed below can be found here.

 

On campus, there are at least three spots for lodging:

 

Ground Transportation

Both Lyft and Uber operate at SFO–and are about $40 to the Stanford area. Pickup is fast and the drive is direct. Get the app for your phone and order. Taxis from the airport to Stanford-area should be about $80-$90. There is also a train (possible until about midnight, $10, but takes a transfer to Caltrain at Millbrae) http://www.bart.gov/guide/airport/index.aspx, and Super Shuttle: http://www.supershuttle.com/ (~$30)

Also consider Socialdrv (http://socialdrv.com/): An shared ride service specializing in airports. You can reserve online ahead, and the drive will track your arrival. It's pretty awesome. 

There's also a SamTrans express bus (route KX)  that runs roughly hourly between the airport and Palo Alto transit center (the bus/train station referred to above): fare $2.00 (03/2013).  Takes just less than an hour. http://www.samtrans.com/schedulesandmaps/timetables.html  Sadly, this very useful route no longer runs. (2015)

Downtown Palo Alto is a pleasant 20-30 min walk from Lathrop Library. The Palo Alto Caltrain station is between downtown PA and campus; it's a 15-25 minute walk to Lathrop (or take the free Marguerite shuttle).