Pain in the area you describe could be heartburn especially if you were asleep.
Reflux can make the acid go up you esophagus and once you sat up, it went back down. It it was sharp, occsionally we can get an inflammation of the rib(s) where the bone and cartilage join called costochondritis. Medications such as Motrin or Aleve (naproxen) taken for several days should help this.
Would you like to video or text chat with me?