I have no real world experience, but Beekeeping for Dummies says for skunks and such, the best thing to do is use a hive stand so they have to stand up to get at it. Then, their belly is exposed. The bees know what to do after that. For racoons, the best deterrant is a big, heavy rock or cinderblock they can't move from the top. I would assume these together would take care of most problems.
I was thinking that when I finally begin my beekeeping adventures that I would put in a motion-activated light. That might frighten pests away when they come creeping in at night.