Based from the information it seems like a "COSTOCHRONDRITIS", which is a inflammation of the joints of rib cage
. It will certainly give sharp pain
like some one is stabbing you, and the pressure changes while turning /tossing in sleep may cause pain.
1) Take OVER THE COUNTER pain medication like ibuprofen
for help in reduction of pain and inflammation of joint.
2) Warm water bag/ cold
sponging may help in pain relief and may help in healing faster.
3) Reduce the physical activity like running , carrying heavy loads till things get back to normal.
4) Rubbing a balm - an counter irritant - like (Iodex India / bangey-hot and ice in USA) will sooth pain.
4) If none of above helps contact near by physician.
Hope it helps,
Dr. JAY PATEL.