Codeine acts on your brain and nervous system to lessen the way you feel pain. Codeine works by weakly binding to a specific opioid receptor, known as the mu-opioid receptor, but with much less affinity than morphine, which means its pain-relieving effects are not as strong as morphine's.