Not something to be entered into lightly, but does work well. This is not a cure, but a successful treatment. The head veterinarian at the Baltimore Aquarium prefers this method. Fast your fish for a couple of days. Withhold all food for three or four days, and sometimes this alone will break up the impaction and return things to normal.
Most fish can go a week to ten days without food and be just fine.
This is another word for surgical removal of part of the swim bladder. I mention this less as a practical option but more just to let people know that there are vets out there doing X-rays, surgery, general anesthesia, even cancer chemotherapy on fish. But the best thing to do is to prevent it from happening in the first place. I'll just add a few of my opinions to Doug's excellent article. Diet seems to be far and away the most common cause of abnormal floating behavior.