Secrets of Comedy: The Contrast Rule
Here's the take-away rule: the more contrast, the more funny.
Now, I'm not saying this is a hard-and-fast rule (in fact, a lot of good comedy is funny because it breaks rules), but it is a good thing to keep in mind when trying to make a joke funnier.
Carl Andrews has a funny spongeball bit in which he places three sponge balls in the spectator's hand (they think it's two) and places an "invisible" sponge ball in his own hand. Then he makes motions and says things that seem to insinuate that the sponge ball will actually materialize in his hand. The punchline occurs when he opens his hand and says, "Vanished!" (Directly afterwards, he directs the audience's attention to the spectator's hand, where the invisible ball not only rematerialized, but joined the other two visible balls.)
How can we use the contrast rule? The longer and more involved the sequence is in which the invisible ball is placed in the magician's hand and the longer the build-up is before the "appearance" (which turns out to be a vanish), the funnier the bit. It's one thing to say "Hey, there's an invisible ball in my hand - look it's gone!" It's a whole different things to say, "I'm going to put this invisible ball in my hand. Did you see anything go into my hand? You sure I didn't sneak anything in here? Because in a moment, you're going to want to remember whether or not I had time to sneak in a regular sponge ball. So watch this - no funny moves - a few snaps and... you're not going to believe this... VANISHED!" The audience is expected the appearance of the ball, so the more you can make this their expectation (by building it up), the greater the contrast with the actual ending. The greater the contrast, the greater the funny!