There is a great deal of state-to-state variability on when and how a person can be medicated against his will.
Typically, in an emergency situation (such as a person being so out-of-control or so combative that he’s at risk of being forcibly put into restraints or seclusion), laws allow for the administration of tranquilizing medications (often as an injection) without the person’s consent.
Once the emergency has passed, however, the rules change. People have the right to refuse treatment, even necessary treatment. There’s active debate, and court cases, around whether or not someone whose judgment is seriously clouded by psychosis, mania, or depression is able to give informed consent to refuse treatment. Each state will have specific statutes around what processes must be followed in non-emergent situations to medicate a person with a psychiatric disorder against his will. Often this will involve legal hearings, typically at the psychiatric hospital or ward, where a judge (not a physician) will determine if the use of involuntary medication should be allowed. These statutes will also specify what kind of legal representation (an attorney) must be made available to the patient.