Pain medication, also known as analgesics, is used to relieve discomfort associated with various conditions by targeting different pathways in the nervous system. These medications range from over-the-counter options like acetaminophen and ibuprofen to prescription opioids, each with specific mechanisms of action and potential side effects.