Valacyclovir is an antiviral medication that helps slow the growth and spread of the herpes virus, allowing the body to fight the infection. It is used in adults to treat genital herpes, cold sores, and shingles, and in children to treat cold sores (age 12 and older) or chickenpox (age 2 and older).