Optogenetic methods have emerged as a powerful tool for elucidating neural 
circuit activity underlying a diverse set of behaviors across a broad range of 
species. Optogenetic tools of microbial origin consist of light-sensitive 
membrane proteins that are able to activate (e.g., channelrhodopsin-2, ChR2) or 
silence (e.g., halorhodopsin, NpHR) neural activity ingenetically-defined cell 
types over behaviorally-relevant timescales. We first demonstrate a simple 
approach for adeno-associated virus-mediated delivery of ChR2 and NpHR 
transgenes to the dorsal subiculum and prelimbic region of the prefrontal cortex 
in rat. Because ChR2 and NpHR are genetically targetable, we describe the use of 
this technology to control the electrical activity of specific populations of 
neurons (i.e., pyramidal neurons) embedded in heterogeneous tissue with high 
temporal precision. We describe herein the hardware, custom software user 
interface, and procedures that allow for simultaneous light delivery and 
electrical recording from transduced pyramidal neurons in an anesthetized in 
vivo preparation. These light-responsive tools provide the opportunity for 
identifying the causal contributions of different cell types to information 
processing and behavior.