Definition: an exclamatory phrase — what the devil!
Origin: Although this will sound counterintuitive, the following phrases: “hurts like the dickens,” “run like the dickens,” “what the dickens” “what the dickens does he want?” or any similar constructions have nothing to do with the well-known Victorian author, Charles Dickens. In this usage, dickens is simply a euphemism for the devil that was developed in the late 16th century. “Dickens” in this context derives from the common English surname “Dickens”, or from “Dickin” the diminutive of “Dick.” For whatever reason, the sound and comic effect of the surname sounded more devilish to the Elizabethans. In fact, the phrase first appears in the work of one of the greatest writers of the time, William Shakespeare — The Merry Wives of Windsor: “I cannot tell what the dickens his name is my husband had him of.” (Act 3, Scene 2).
For further reading: Brush Up Your Shakespeare by Michael Macrone, Harper and Row (1990).