Certain drugs are used to treat specific types of pain and its causes, such as inflammation or muscle spasms.