Antiviral medications are used to treat a wide variety of infections caused by viruses. These types of medication operate by slowing the reproduction of virus cells making it easier for the immune system to control the spread of the infection. Medications of this type are commonly used to treat conditions such as herpes, hepatitis B and C, HIV, or influenza A and B.