The first thing to do is to make sure that the culprit is actually teething. If your baby has been sleeping well and has suddenly begun waking with a sharp-sounding cry (usually an indication of pain), look for some of the symptoms of acute teething - swelling or discoloration on the gum, unusually fussy behavior, pulling on the ear, possibly a low-grade fever with no other symptoms. If you see none of these symptoms, then it probably isn’t his teeth that are causing pain; your child may be sick (note that ear infections are particularly difficult to self-diagnose, as it’s hard to see symptoms). Consult your pediatrician, who can determine the source of your child’s discomfort
If your baby is actively cutting a tooth, you can, with your doctor’s permission, offer pain reliever about 30 minutes before bedtime; if your baby wakes throughout the night, go to him immediately and do whatever necessary to help comfort and soothe him. (You can even feed him if you’d like, but if you’ve already begun weaning nighttime feeds, try to soothe him in other ways first, such as by holding or rocking him.)
Once the tooth cuts through the gum, your baby's pain significantly diminishes, and his mood and behavior should return to normal. At that point, help your baby return to his good sleep foundation, putting him down awake and doing check-ins as needed.