If you have bacterial pneumonia, the most common kind, your doctor will probably prescribe antibiotic drugs. It's important to take the drugs on schedule. Don't stop taking the pills when you start feeling better. Finish the full prescription to be sure you've treated the infection completely and to keep it from coming back. Antibiotics don't help treat viral pneumonia. In most cases, people with viral pneumonia get better by themselves. In some cases, antiviral medications may be prescribed. For people who are at risk of getting a bacterial infection on top of viral pneumonia, doctors sometimes prescribe antibiotics.