That's why I always place my books on the shelf, spine facing out.
Well, with the spine facing out you help to prevent "Broke-back Mounting".
Cheers!
Full Disclosure: Don't believe ANYONE who tells you they went to see Brokeback Mountain because they're a fan of Anne Hathaway!