Pneumonia is an infection that causes inflammation in one or both lungs. The infection can be caused by different kinds of bacteria and viruses, and it can be very serious if it is not treated properly. However, most cases of pneumonia are fairly mild and it can often be treated at home, with medical advice.