Du`a for Pain in Body
Question

I get bad pains in the front sides of my head. Is there a prayer or something I can do to stop this pain?
Praise be to Allah.Reward for facing sickness with patience
With regard to the sickness that you have, if you bear it with patience and seek reward , Allah will make your sickness an expiation for your sins. 
It was narrated from Abu Sa’id al-Khudri and Abu Hurayrah that the Prophet (peace and blessings of Allah be upon him) said: “No tiredness, exhaustion, worry, grief, distress or harm befalls a believer in this world, not even a thorn that pricks him, but Allah expiates some of his sins thereby.” Narrated by al-Bukhari, 5318 and Muslim, 2573. 
Recommended remedies for pain in body
We recommend to you some remedies and du`as that are prescribed in shari’ah. Remedies include the following: 

Honey. Allah says (interpretation of the meaning): 

“Then, eat of all fruits, and follow the ways of your Lord made easy (for you).” There comes forth from their bellies a drink of varying colour wherein is healing for men. Verily, in this is indeed a sign for people who think.” [al-Nahl 16:69]

Indian aloes wood (al-‘ud al-hindi). 

It was narrated that Umm Qays bint Muhsin said: I heard the Prophet (peace and blessings of Allah be upon him) say: “You should use Indian aloes wood for in it are seven cures.” (Narrated by al-Bukhari, 5368; Muslim, 287)

Cupping 

It was narrated from Ibn 'Abbas that the Messenger of Allah (peace and blessings of Allah be upon him) was treated with cupping when he was in a state of ihram on his head for a migraine that he was suffering from. (Narrated by al-Bukhari, 5374; Muslim, 1202)
Al-Bukhari included it in a chapter which he called: Chapter on cupping for migraines and headaches. 

Black seed 

It was narrated from Abu Hurayrah that the Prophet (peace and blessings of Allah be upon him) said: “In the black seed is healing for every disease except death.” (Narrated by al-Bukhari, 5364; Muslim, 2215)
Du`a for pain in body
With regard to the du`as which we recommend to you, we will mention some du`as from the sahih Sunnah: 

It was narrated from ‘Uthman ibn Abi’l-‘As that he complained to the Messenger of Allah (peace and blessings of Allah be upon him) about a pain in his body that he had suffered from the time he became Muslim. The Messenger of Allah (peace and blessings of Allah be upon him) said to him: “Put your hand on the part of the body that hurts and say Bismillah (in the name of Allah) three times. And say seven times: A’udhu Billahi wa qudratihi min sharri ma ajidu wa uhadhir (I seek refuge in Allah and His power from the evil of what I feel and worry about).” (Narrated by Muslim, 2202)


It was narrated from ‘Aishah (may Allah be pleased with her) that when the Messenger of Allah (peace and blessings of Allah be upon him) came to a sick person or a sick person was brought to him, he would say: “Adhhib al-ba’s Rabb an-nas, wa’shfi anta al-Shafi, la shifa a illa shifauka shifa an la yughadiru saqaman (Take away the pain, O Lord of mankind, and grant healing, for You are the Healer, and there is no healing but Your healing that leaves no trace of sickness).” (Narrated by al-Bukhari, 5351, Muslim, 2191)

You should also recite al-Fatihah and al-Mu`awwidhat, and in the whole Quran there is healing, as Allah says (interpretation of the meaning): 
“And We send down of the Quran that which is a healing and a mercy to those who believe (in Islamic Monotheism and act on it), and it increases the Zalimun (polytheists and wrongdoers) nothing but loss.” [al-Isra 17:82]
        3.  It was narrated from Abu Sa’id al-Khudri (may Allah be pleased with him) that some of the Companions of the Prophet (peace and blessings of Allah be upon him) came to one of the Arab tribes. They asked them for hospitality but they refused to welcome them. Whilst they were like that, the chief of that tribe was stung. They said: ‘Do you have any remedy or someone who can recite ruqyah?’ They said: ‘You did not offer us hospitality, so we will not do anything until you give us something in return.’ Then they agreed upon a flock of sheep. Then he started to recite the Essence of the Quran – i.e., Surat al-Fatihah – and he collected his saliva and spat at him (at the site of the injury), and he recovered. The sheep were brought and they (the Companions) said: We will not take them until we ask the Prophet (peace and blessings of Allah be upon him). So they asked him and he smiled and said: “How did you know that it is a ruqyah? Take them and give me a share of them.”  (Narrated by al-Bukhari, 5404; Muslim, 2201)

It was narrated from ‘Aishah (may Allah be pleased with her) that the Prophet (peace and blessings of Allah be upon him) used to recite al-mu`awwidhat and blow over himself during his final illness, and when he became too ill (to do that), I used to recite them and blow over him and wipe his hand on him for blessing. 

Mu`ammar said: I asked al-Zuhri how he used to blow and he said: He used to blow on his hands then wipe his face with them. (Narrated by al-Bukhari, 5403; Muslim, 2192)
And Allah knows best.