if pain is there never do the yoga
or exercise at that particular position.
if any posture of yoga is painful you should not practiced that posture that will give reverse effect.
your problem will be due to some sort of inflammation or degeneration but we cant get clear picture by your explanation
any way you need medication along with some special treatments of ayurveda what we are doing at kerala
for more details you can contact with full details