Yes
Praying and its scientific effects on pain reduction have been proven.
Stress reduction: By creating mental peace, prayer can reduce stress and mental tension that lead to pain.
Physical movements: Prayer movements such as bowing and prostration help improve blood circulation and reduce muscle and joint pain.
Increased endorphins: Spiritual practices such as prayer may increase levels of endorphins, the body's natural painkillers.
Source: The Book of Modern Sciences in Islam