Optical methods of interrogating neural circuits have emerged as powerful tools for understanding how the brain drives behaviors. Optogenetic proteins are widely used to control neuronal activity, while genetically encoded fluorescent reporters are used to monitor activity. These proteins are often expressed by injecting viruses, which frequently leads to inconsistent experiments due to misalignment of expression and optical components. Here, we describe how silk fibroin films simplify optogenetic experiments by providing targeted delivery of viruses. Films composed of silk fibroin and virus are applied to the surface of implantable optical components. After surgery, silk releases the virus to transduce nearby cells and provide localized expression around optical fibers and endoscopes. Silk films can also be used to express genetically encoded sensors in large cortical regions by using cranial windows coated with a silk/virus mixture. The ease of use and improved performance provided by silk make this a promising approach for optogenetic studies.