I would suggest that you go see your primary care doctor
about this complaint, especially since it seems to have been going on for some time. They will be able to perform a good physical exam and help your figure out what might be going on.
I think that your instinct that this is related to a muscle spasm is probably on the right track. The muscles between ribs, called the intercostal muscles, can easily become strained from heavy lifting or even just 'sleeping funny.' This can lead to spasm and pain or discomfort, especially with deep breathing, coughing, or laughing. Similarly, the cartilage where the ribs and the sternum (breastbone) connect together can sometimes become inflamed. This is called costochondritis and it can cause similar symptoms. If your doctor diagnoses you with either of these conditions, they will like prescribe rest and anti inflammatory medications to help take away the discomfort.
With any pain in the chest, it is important to make sure the pain is not caused by a more serious problem. For these reasons, make sure to mention to your doctor if you experience any shortness of breath, cough, deep chest pain, dizziness
, or trouble with exercise.