Vitamin D helps bolster the immune system to tackle viruses that attack the lungs, the researchers said.