J.S.
My son who is now 18 mos has gone through biting phases every time he gets new teeth. I follow the same advice as others gave -- "Ouch, don't bite! Biting hurts." I rub the area he bit and I turn my back to him and walk away from him or if he's on my lap I put him down and turn away from him. I ignore him for a short time (like a minute or two).
Sometimes he will bite when he is hungry, so if it has been a while since he ate or if he hardly ate anything at the last meal, I will ask him if he's hungry. We do sign language, so I ask "are you hungry?" and sign "eat". He will sign back "eat" and go to the kitchen if he's hungry.