Costocondritis. Without having much to go on, one possibilty is costocondritis. As the word implies, this is an inflammation of the rib cartilages. With breathing and therefore movement of the chest wall, this can elicit pain. This condition is usually self-limiting and the pain symptoms are treated with nsaids (motrin, for example).
Many things. Lung infections, chest wall or lung inflammation, pericarditis (inflammation of the lining of the heart, pulmonary embolism (blood clot in the lung vessels), strained muscles between the ribs, and shingles are some of the possible causes.