Antiviral medications are used to treat infections caused by viruses. For example, oseltamivir (Tamiflu) is prescribed for influenza, and acyclovir is used for herpes simplex virus infections. These medications can reduce the severity and duration of symptoms if started early in the course of the illness.