Fainting (syncope) is a sudden loss of consciousness from a lack of blood flow to the brain. Victims usually wake up quickly after collapsing.
In cartoons, fainting is always done by falling over stiff as a board and landing either flat on your face or back. In movies, the classic melodramatic faint was with a gasp, a hand to the forehead and collapsing into the arms of the nearest male heartthrob. In real life, fainting ranges from subtle to violent.
More important than immediate treatment is to treat the cause of the fainting. Often, the only way to identify the cause is to look at the victim's chronic medical problems, if any, and recent activities or illnesses.
Sometimes, there's absolutely nothing you can do to stop from fainting, but if you feel it coming on there are a few things that may help.
If this is the first time this person has ever fainted -- or if you don't know -- I recommend calling 911. There are some dangerous conditions that can cause fainting and will require an evaluation by medical professionals to determine how to proceed.