A sharp pain in the chest or ribs when breathing in may be due to a muscle strain or anxiety. It can also sometimes indicate an injury, pneumonia, pleurisy, or pericarditis, which may need urgent ...