Think that this is great purification. You should use this situation of having pain to do tonglen, so that the sentient beings may be free from all obscurations and all the sickness and become enlightened.
Pray like this:
By my experiencing this pain, may all sentient beings be free from all the obscurations and negative karma and sickness, and may they achieve enlightenment.
By my experiencing this pain, may it be for all sentient beings.