If you still continue to have cough
togather with this pain, it is likely to be a pneumonitis
(infection of lung) or a pleuritis
(inflammation of membrane covering the lung). Please get a chest x-ray done. You may need a course of antibiotics and pain killers/ antiinflammatory drugs togather with a cough formula.
Hope this answers your query, I will be glad to reply any follow up query that you have.
Wishing you best of health.