Opioids are a class of drugs used to reduce pain. Prescription Opioids Prescription opioids can be prescribed by doctors to treat moderate to severe pain, but can also have serious risks and side effects. Common types are oxycodone (OxyContin), hydrocodone (Vicodin), morphine, and methadone.