Why would a doctor prescribe an analgesic?

For pain relief