The saying "Hair of the Dog"
Solution 1:
The full phrase is "the hair of the dog that bit you" (from Wikipedia):
The expression originally referred to a method of treatment of a rabid dog bite by placing hair from the dog in the bite wound. The use of the phrase as a metaphor for a hangover treatment dates back to the time of William Shakespeare.
Solution 2:
Following on from Kosmo's answer, it also implies that, by drinking alcohol to cure your hangover, you're ingesting more of the same thing that hurt you in the first place.