I get letters all the time from people complaining about how horrible their bosses are (or were) and how they've managed to deal with the situation. A common theme seems to exist in all of these letters; "I work for someone who doesn't get it, and they work for someone who refuses to see that they don't get it."
Horrible bosses don't become that way overnight; they often will see what they can get away with and what their boss will turn a blind eye to, and then continue to calculate attacks, mistreat others, and perform poorly until the day finally comes where someone comes across their way who won't put up with it anymore.
As I've said in prior posts, sometimes the best things to do to avoid a horrible boss are to find a new job or find a way to deal with the boss until they end up leaving on their own.
A great book worth reading on horrible bosses and how they affect the workplace is Good Boss, Bad Boss: How to Be the Best and Learn from The Worst
In this book, Robert Sutton outlines the things you can do to learn from the worst bosses ever, and how to avoid becoming one yourself!