If you didn't have the foresight to drink water before you went to bed make sure you down a few pints now.
Experts suggest that about 200ml of water is needed to effectively counteract every 30ml of alcohol you drink.
If your body is not hydrated it will take water from wherever it can, including the cells of the brain. Your brain can't feel pain so as those cells start to shrink due to water loss, the pain-sensitive filaments connecting the outer cell membranes to the inside of your skull become stretched which results in a headache. The more dehydrated you are the worse your headache will be.