When one is experiencing bodily pain, one should place his right hand on the affected area and recite bismillah thrice, followed by the following dua seven times:
أَعُوذُ بِاللهِ وَقُدْرَتِهِ مِنْ شَرِّ مَا أَجِدُ وَأُحَاذِرُ
I seek refuge in Allah Ta‘ala and His power from the evil that I am experiencing and from the evil of that which I fear.
عن عثمان بن أبي العاص الثقفي، أنه شكا إلى رسول الله صلى الله عليه وسلم وجعا يجده في جسده منذ أسلم فقال له رسول الله صلى الله عليه وسلم: ضع يدك على الذي تألم من جسدك، وقل باسم الله ثلاثا، وقل سبع مرات أعوذ بالله وقدرته من شر ما أجد وأحاذر (صحيح مسلم، الرقم: 2202)
It is reported regarding Hazrat Uthmaan bin Aas (radhiyallahu ‘anhu) that he once complained to Rasulullah (sallallahu ‘alaihi wasallam) regarding bodily pain that he was experiencing from the time he had accepted Islam. Rasulullah (sallallahu ‘alaihi wasallam) said to him, “Place your hand on the place where you are feeling the pain on your body, and recite bismillah thrice followed by the following dua seven times:
أَعُوذُ بِاللهِ وَقُدْرَتِهِ مِنْ شَرِّ مَا أَجِدُ وَأُحَاذِرُ