I think that the joke and the ghost story both have a similar set up in that you kind of set something up and pay it off with a laugh or a scare.
or simply: