Generally, toothaches are caused by inflammation of the nerve inside the tooth. The best way to temporarily relieve the pain is by taking a nonsteroidal anti-inflammatory over-the-counter medication such as naproxen sodium (Aleve) or ibuprofen (Motrin). If the tooth is sensitive to temperature and biting pressure, then it likely needs a root canal to completely resolve the pain. If there is swelling around the tooth or in the face, then the nerve inflammation has progressed to an infection and antibiotics and a root canal are required to fix the situation.
You may be tempted to use over-the-counter toothache remedies such as topical anesthetic (Orajel). However, these medications are best used to treat sore gum tissue caused by ulcers or canker sores and will do little to remedy actual tooth pain. Remember, a toothache is caused by an inflammatory process that is occurring within the tooth (and not in the surrounding gums). Additionally, do not try crushing aspirin or other medications and placing them against the tooth area. These medications are only meant to be taken orally, and can cause serious chemical burns on the gum tissue and mucosa.