Polygraphs measure
respiration, heart rate, blood pressure, and skin
conductivity. A lot of claims are made about the accuracy of polygraphs, but what they really measure are your level of anxiety. The operator asks you a series of questions. Answers that make you uncomfortable cause you to sweat slightly (therefore changing your skin conductivity), cause your blood pressure to rise, your heart rate to change, and your breathing to change.
The rest is subjective.
A polygraph usually begins with an interview. You're asked a series of questions, things that are specific to the subject you're being grilled on, and general things about your credibility. ("As a child, did you ever attempt to mislead authority figures?") The operator also attempts to establish his or her own credibility and training, and that of polygraphs in general. ("When I worked for the US Government, I was responsbile for catching *3* KGB agents")
As you sit in a chair, sensors attached to your body are hooked up to a computer, or the old fashioned analog type of machine like you see on tv. ("This computer uses *three* *different* algorithms to decide whether you're lying") There's a band around your chest to measure breathing, a clip on your finger to measure skin conductivity, and a blood pressure cuff around your arm which measures pulse and blood pressure.
You're asked to close your eyes, remain still, and breathe consistently while you're asked questions. If you, say, pause in your breathing, the operator may accuse you of trying to "deceive the machine".
Often, the operator will try to establish a baseline for your response by telling you to deliberately lie. ("I'm going to ask you your name. Respond by saying, 'My name is x'"; where x != your name) Then they'll go through the questions (including things like "Do you intend to lie to me today?") two or three times.
The rest is up to the operator.
Most of the stuff out there about beating polygraphs is a crock of shit. (Then again, so are polygraphs.) The polygraph operators have read all the books, pamphlets, and web pages with all the techniques. They even ask you if you've read about it.
re: How to Beat a Lie Detector -- on one occasion, the operator made me remove my shoes and felt my feet to see if I was using this technique.
Also, there are a number of cases where polygraphs *are* allowed as evidence in US courts. Rules vary from state to state.
Source: personal experience (failed one, passed another)