A dentist will conduct a complete oral examination to determine the localtion and cause of the toothache, looking for signs of swelling, redness and obvious tooth damage. He or she may also take x-rays looking for evidence of tooth decay between teeth, a cracked or impacted tooth, or a disorder of the underlying bone-problems that the dentist may not be able to find through a routine exam.
The dentist also may prescribe pain medication or antibitics to speed the healing of your toothache. If, by the time you see your dentist, your tooth has become infected, then treatment could require removal of tooth or a root canal procedure, which involves removing the damaged nerve tisue from the middle of a tooth.
Source: Academy of General Dentistry