Megestrol and Amitriptyline both affect the nerve cells that carry pain sensations to and from the brain. Both drugs reduce the intensity of the pain signals going to the part of the brain that feels pain. Each drug attaches to the nerve cell but at separate spots on the nerve cell so pain can be better managed.