Thanks for your question - it is certainly a common problem for people who have been experiencing a chronic cough and is mainly due to an overload of the intercostal muscles, or in more severe cases, a localised stress reaction of the bone.
Often, there are no externally visible changes but lying down on the side and taking deep breaths can trigger off the pain.
Simple measures usually include anti-inflammatories, heat packs and topical rubs. In situations where the cough is ongoing, holding a towel around the chest while taking a deep breath or coughing, can help support the muscle and bones and therefore limit the pain symptoms.
If its going on for more than a few weeks, I would suggest getting is assessed.
Hope this helps.
Dr Dinesh