The lungs are responsible for the exchange of oxygen and carbon dioxide. Oxygen is taken up by the bloodstream and transported to the body's cells, while carbon dioxide, a waste product, is removed from the cells and expelled through exhalation.