Morphine is often used before or after surgery to alleviate severe pain. Morphine and other opioids act by attaching to specific proteins called opioid receptors, which are found in the brain, spinal cord, and gastrointestinal tract.When these compounds attach to certain opioid receptors in the brain and spinal cord, they can effectively change the way a person experiences pain.orphine and other opioids act by attaching to specific proteins called opioid receptors, which are found in the brain, spinal cord, and gastrointestinal tract. When these compounds attach to certain opioid receptors in the brain and spinal cord, they can effectively change the way a person experiences pain.