Health professionals, to avoid transferring bacteria from their mouths to patients, usually wear a surgical mask, during surgery, or when visiting vulnerable patients. The surgical mask may also protect against blood splatters from a patient during surgeries. It is usually made of paper or synthetic materials suitable for one-time use only.
Some people also wear a paper or synthetic surgical mask to protect themselves from pollen inhalation during hayfever months. This may provide some benefit, and help reduce inhaled pollen, but again it should not be reused. Because a sterile mask is not necessary when you are trying to avoid pollen, there are better face masks than the sterile surgical mask to keep pollen out of the nose and mouth. Others use a surgical mask to protect themselves from disease, but this is actually not a benefit of the mask.
When Severe Acute Respiratory Syndrome (SARS) outbreaks in China, Hong Kong and Vietnam threatened the local population, many could be seen wearing surgical masks in public in the hopes that these would offer them a little extra protection against SARS. In reality, viral particles of diseases like SARS can easily penetrate a surgical mask. In order for true protection to be provided, you would need an airtight mask that can trap tiny virus particles, like the National Institute for Occupation Safety and Health (NIOSH) masks.
People with SARS, or any illness can protect others from a some exposure by wearing a surgical mask. Yet if a person infected with SARS coughs or sneezes, viruses will penetrate most surgical masks. There is still chance of viral transmission when a person with a highly contagious disease wears a surgical mask. To this end, when certain superflus are suspected, medical workers may wear masks with respirators and special safety suits so that the virus cannot be transmitted.
The surgical mask also has a somewhat limited time period in which it will be effective. They frequently will only work for an hour or two at most. Moisture from the mouth and nose will ultimately transfer to the outside of the mask, making the simple surgical mask sterile for only a short time period. When parents or friends visit people with extremely vulnerable immune systems from diseases like cancer, they usually must exit the room and change their masks after an hour or two.
Even though wearing a surgical mask may briefly protect others from any germs you might be carrying, the principle means of avoiding virus transmission is still through good handwashing practices. These should be observed in any public setting, and are a particularly important practice in hospitals.