I don't think it's your lung, it's most likely a muscle cramp in your midsection.
When you have this sharp pain, hold your arms up straight like you reach for the sky and breathe in as deep as you can. You will hate me for it as it's painful but after that, it will be gone.