It depends on what you mean by a really bad boss. I've had some bosses that kept having me do things that were not really my job. I may not have liked it at the time but I learned so much from being pushed through the experience. Eventually it became a positive step in my career, something that I would have never done otherwise.
Being mean is often a method of protecting oneself by pushing other people away. What happened in your bosses life that was so terrible that he/she had to decide not to let anyone in? It's been my experience that, when everyone thinks something bad of someone, they are often all not taking the time to understand that person. They may not even really feel that way, but they say it so that they are not judged the others as weak.
When dealing with a boss that you feel is being mean to you, just be sure not to have a double standard. Consider how you would react to actions you are considering taking. Would it be viewed as something positive? For example, how would you feel if people talked poorly about you behind your back? Is there any chance at all that there might be some truth to what your boss has been saying? You may not like what you are hearing but are you 1000% absolutely certain that it is not true at all, even perhaps just a little? There is usually at least some small amount of truth when you try to see things through their eyes, just as you are probably justified to be feeling resentful from your own perspective.
When dealing with a mean boss, you might want your boss to see things your way but have you considered trying to see the situation from their perspective? If you were the boss, what would you hope to get from your employee? Perhaps some understanding of the situation… just like you.
You might be starting to realize that you actually have something in common with your boss. You are the two faces of the same coin. So now dig out the best version of yourself and, with congruence in mind and in your heart, start to figure out how you would hope to resolve the issue. It time to be completely honest with yourself
Is it time to talk with your boss like a mature adult? Some people are natural born leaders. Some leaders need to learn how to step up without crushing others. Then again, maybe they aren't even aware about how you feel or that there is even a problem.
People only have power over you as long as you let them. There over thirty million people in Canada and over three hundred million people in the U.S.A. There are over 7 billion people in the world. If you feel that you have done everything that you could possibly do to resolve the situation and your boss simply doesn't care, there's no reason to work for one person who has no respect for you.
You could get rid of the problem by seeking a promotion within the current company or moving to a completely new company. This isn't running away, it's working towards and enabling you to be the best version of yourself. Regardless of how you feel, always try to leave your current employer on good terms. You never know when you might need them again. They could end up being your next client in your new job.
That said, do make sure you have another job before you quit your current one if possible.