What medications can I take for tmj?

NSAID's. Nsaid's such as Ibuprofen are typically the first medication to try. If low occasional doses of Ibuprofen don't do the trick, you really need to see a dentist about a bite splint (something to wear at night). I typically use an 'anterior bite plane' 24x7 for 2 weeks with a steroid for the first week. After this, the buite guard goes to nighttime use only. This does the trick in 99% of cases.
Depends on the cause. Meds and surgery should be the last lines of defense for tmj/tmd, it depends on what treatment you have already had, if any, and the degree of success of the treatment. Should see a dentist or specialist before depending on meds. The source of the problem is imperative!
TMJ. You may try mild antiinflammatory medications like Aleve (naproxen) (granting you do not have allergy or stomach problems like ulcer) or muscle relaxant. Relaxation technique may also alleviate the symptoms.