Bacterial pneumonia. This type is caused by various bacteria. The most common is Streptococcus pneumoniae. It usually occurs when the body is weakened in some way, such as by illness, poor nutrition, old age, or impaired immunity, and the bacteria are able to work their way into the lungs. Bacterial pneumonia can affect all ages, but you are at greater risk if you abuse alcohol, smoke cigarettes, are debilitated, have recently had surgery, have a respiratory disease or viral infection, or have a weakened immune system.