Optogenetics combines optical and genetic methods to rapidly and reversibly control neural activities or other cellular functions. Using genetic methods, specific cells or anatomical pathways can be sensitized to light through exogenous expression of microbial light activated opsin proteins. Using optical methods, opsin expressing cells can be rapidly and reversibly controlled by pulses of light of specific wavelength. With the high spatial temporal precision, optogenetic tools have enabled new ways to probe the causal role of specific cells in neural computation and behavior. Here, we overview the current state of the technology, and provide a brief introduction to the practical considerations in applying optogenetics in vivo to analyze neural circuit functions.