Hangovers are just dehydration. Since alcohol is a diuretic you end up pissing out more than you drink and you get dehydrated; thus water will help mostly prevent the hangover. I'm sure a portion of it is your brain being ravaged by alcohol as well so there is usually a portion that you can't escape but a small headache is better than not being able to walk cause you feel like puking and your head is about to explode.
Worst hangover i ever had was from the second time I drank actually. I drank an entire mickey (375 ml) of rum in about 15 minutes and only chased it with 1 pop and nothing else all night. By the time we got to the persons house (which was about 25 minute walk away) I couldn't walk straight and I had fallen about 10 times. My buddy and i were there for a total of 40 minutes before I fell on the t/v and got us kicked out. Then I zigzagged around and Alan had to pretty much drag me into his house towards the end of the walk because a fucking massive thunderstorm hit. The next day I remembered the following things from the night before from after i drank: walking through a field, sitting in a driveway, sitting on a couch watching Jerry Springer, someone playing with the radio, using the washroom, getting caught in the rain 5 minutes from Alan's house. That was my entire night. And the hangover from it was so bad that i almost threw up about a dozen times, I could barely walk, I couldn't eat, and I had to call in sick for work. After that I started paying attention to how much I drink. Though I think it significantly raised my limits.