Optogenetics, that is, the control of cell activity using photosensitive ion channels, opsins, with the light of a specific wavelength, is increasingly being used to study the activities and functions of neurons. The expression of opsins in the cell membrane, making the cell sensitive to light, is achieved by means of the viral vectors, mainly constructed using lentiviruses or adeno-associated viruses (AAVs), with the inserted nucleotide sequences encoding the photochannel proteins. The specific promoter for the target cell type added to the transgene expression cassette provides opsin production only in these target cells. The aim of this work was to briefly describe the optogenetic method, as well as to analyze the possibility to use administration of viral vectors into the brain of neonatal animals to study the function of neurons in vivo during subsequent periods of development. In this analysis, 3-day-old rat pups are intracerebroventricularly injected with the optovector (pAAV-CAMKIIa-ChR2h134-YFP) coding for a neuron-activating photochannel and a marker, yellow fluorescent protein, under the CAMKIIa promoter, specific for glutamatergic neurons. The peak expression of the transferred gene is usually achieved 3–5 weeks after the vector transfer, which is also observed in our experiments. Stimulation of the hippocampal neurons with blue light in the 20-day-old animals injected with the optovector on 3rd day of their lives increases the discharge activity of these neurons, as well as the expression of c-Fos protein, a well-known marker of neuronal activation. The same experiments with older animals (60 days after the neonatal optochannel gene transfer) demonstrate neither any noticeable expression nor photoactivation of the target hippocampal neurons. Thus, the neonatal administration of a viral vector carrying an optochannel gene is suitable for the study of brain neurons in juvenile rats but requires additional assessment of the corresponding gene expression during subsequent periods of development.