Infectious diseases are caused by a variety of organisms, including viruses, bacteria, fungi and parasites. There are just as many different ways that infections can spread. Sometimes, they're carried by vectors like flies, mites, mosquitoes or rats, which pass their diseases by biting or stinging humans. Many infections are spread via bodily fluids -- you would have to have unprotected sex with an infected person or be exposed to their blood or saliva. Others are transmitted by the delightfully named fecal-oral route, which means that one person has expelled stool contaminated with a pathogen and another person has consumed that stool (hence the outrage when news outlets expose the amount of fecal matter present on escalator rails and doorknobs -- good hygiene and diligent hand washing are vital to preventing fecal-oral transmission).
Sometimes, though, the very air you breathe is a threat. There are two ways that infections can go airborne. First, an infected person could expel the contaminant into the air by coughing, sneezing, laughing, spitting or even breathing. This is why a person hacking a lung up on public transportation is subject to such dirty looks -- once he or she has coughed, the entire bus or train car is vulnerable to contracting the infection by breathing the same air, as the infection hangs in the air in the form of a droplet. Infections also go airborne thanks to certain environmental disruptions. Consider a storm that stirs up dust; if that dirt harbors fungi, bacteria or viruses, it could travel through the air and cause everything from allergies to death.
Once an infection goes airborne, a few factors determine how long it will stay there, including the size of the droplet, the composition of the droplet and environmental factors. For example, in climates of high humidity, the infected droplet absorbs water from the air and becomes much too heavy to stay airborne. That doesn't mean it's not harmful anymore -- after all, it could land on toys, telephones or surfaces within a household, and the infection may remain alive long enough to infect someone who touches it and then touches their mouth or their eyes. But at that point, should you take a disinfecting wipe to your kitchen counters, you have a better chance at avoiding infection than you would if the droplet remained airborne. As long as it remains airborne, you could breathe it in at any time. Additionally, some dust particles and droplets infected with bacteria and viruses can travel very long distances, so not only are you at risk for infection, so are those around you.
Chicken pox, influenza, small pox, tuberculosis, SARS and whooping cough are but a few of the conditions that can be contracted through airborne transmission. To prevent airborne transmission of an infection, sick people should always cover their mouths and noses when coughing or sneezing and wash their hands frequently. Caregivers should also wash their hands frequently and minimize close contact with the sick. Face masks may also provide some protection.