Bacterial pneumonia. This type is caused by various bacteria. The most common is Streptococcus pneumoniae . It often occurs when the body is weakened in some way. This may be from illness, poor nutrition, older age, or impaired immunity. Then the bacteria can work their way into the lungs. Bacterial pneumonia can affect all ages. But you are at greater risk if you abuse alcohol, smoke, are weak, have just had surgery, have a respiratory disease or viral infection, or have a weakened immune system.