Acyclovir is a nucleoside analog that mimics the structure of guanosine, one of the building blocks of DNA. When acyclovir enters a cell infected with a virus, it is phosphorylated by the viral enzyme thymidine kinase to become acyclovir triphosphate. This active form of acyclovir competes with deoxyguanosine triphosphate for incorporation into viral DNA. Once incorporated, it causes chain termination, effectively halting viral DNA synthesis and replication.