The coughing is what has done this to you. It seems that when we cough, especially if laying down, that it is easy to pinched muscles or nerves in the back. Once pinched and you try taking a breath it puts even more pressure on the nerve and gives you the bigger pains. You have to release the nerve to get rid of the pain. Here is how to release the muscles and nerves in your back:
(do from a sitting position)
Place your left hand on your left leg next to your body. Place your right hand over your left shoulder and find the muscles next to your spine and press on them and hold. After 30 seconds slowly lower your body forward, keeping your left arm fairly straight as you do. When you reach your lap remain there for another 10 seconds, release the pressure but remain there for another 30 seconds. Then reverse your hand positions and do your right side.
If you have trouble with the lowering yourself down into your lap, just try leaning sideways as far as you can instead, and somewhat forward. You have to get your back to open up some with the leaning to release the pinched parts.