Pulmonary surfactant is used as a medication to treat and prevent respiratory distress syndrome in newborn babies.