The pain that occurs on deep breath and which is well localized is either due to a rib/ muscular pain
or it is pleural pain (a membrane covering the lungs). The lungs normally do not pain as they do not have pain receptors!
A short course of pain killers will abort the pain. Get your chest X-ray done to rule out pelurisy.