It depends on what I'm feeling bad about and how bad i'm feeling. It also depends on whether I'm the GM or player and what kind of game it is.
If I'm just feeling a little down, playing is a pick me up. If I'm feeling really awful, then I'm not likely to be in a mood to enjoy the game. In addition, I likely won't play very well, and I will likely feel even worse after the game as I think about all the mistakes I made.
If it's just a bad mood, playing is worthwhile. If I've had a life changing event like someone's death, then that is something that requires time to deal with, and I am likely to cancel all of my games until I have had some time to deal with it emotionally.
If I am a player, I am less likely to cancel, as playing is less intense and stressful than GMing. Not that I don't enjoy GMing just as much, but as Aberzanzorax mentioned, even good stressors are still stressors and can negatively affect you when you are not doing well. In addition, GMing requires more time spent preparing than playing does, and that means less time spent trying to deal with the problem, if there is one.
If the game is just a beer and pretzels game or a one shot, particularly with people who are friends outside of the game, I am more likely to play than if it is a deep character drama and/or with people I don't know as well.