It could be a lot of things...and you do need to see your doctor,....that is evident, pain is a good thing it lets us know something is wrong, It could be pleurisy, or pneumonia, asthma, bronchitis, heart congestion, mesothelioma, tuberculosis, these things are a stretch so don't freak out, there are others that i didn't put down because you need to be seen and not jump to a bunch of false conclusions...you didn't give enough details to really conclude anything, pain mean something, something needs to be looked at by a doctor asap.
Probably you need more exercise. But it could be something serious. Check out WebMD.com and go through some symptom checkers. You'll probably find it's nothing, but if there is an issue it'll give you some good starting points to talk to a medical provider about.