The pain could be because of coughing due to bronchitis
. However you should get a xray chest done to rule out any other lung pathology. If it is normal, continue your treatment for bronchitis. You may take a pain killer. It will be alright in due course of time.