Pneumonia is generally treated with antibiotics if caused by bacteria or antiviral medications if caused by a virus. Doctors may also recommend over-the-counter fever and pain medication. For severe cases, patients may need oxygen therapy or intravenous fluids at the hospital.