I'm providing an absurd example here, but bear with me. Consider the following "joke":
Some chick invited Tim Tebow to her senior prom which is just plain ridiculous, everyone knows he won't put out.
Now, the source of the humor in this is the implicit assumption that inviting Tim Tebow to a prom is ridiculous, however the author then says that this ridiculousness is for an entirely different reason, contradicting our (the reader's) initial assumption. This is obviously but inexplicably humorous.
Is there a name for this mechanism?