Humor is one of our body's natural defense mechanisms against being scared. Think about the times that you've been scared or concerned about something but didn't want your friends to know (or wanted to talk yourself out of being afraid). Chances are, at some point you joked about it. Maybe you joked about how tough you are, or how small/insigificant/biteless your concern was, or whatever. Our minds don't like being scared any more than we do, so you try to replace one extreme emotion with another. Since laughing always feels good, it makes sense to try to make light of a bad situation. Humor is also used this way in very sad or tragic situations.