The causal analysis of neuronal network function requires selective manipulations of genetically defined neuronal subpopulations in the intact living brain. Here, we highlight the method of optogenetics, which meets those needs. We cover methodological aspects, limitations, and practical applications in the field of neurosciences. The fundamentals of optogenetics are light-sensitive transmembrane channels and light-driven ion pumps, which can be genetically encoded, without requiring the application of exogenous cofactors. These opsins are expressed in neurons by means of viral gene transfer and cell-specific promoters. Light for stimulation can be non- or minimally invasively delivered by optical fibers. Illumination of opsins results in a depolarization or hyperpolarization of genetically modified neurons, depending on the type of optogenetic actuator. Strong expression levels and sufficient light densities provided, neuronal activity can be optically controlled in the intact network with millisecond precision. By applying fluorescent indicators of neuronal activity, an all-optical neurophysiological approach becomes reality.