Methods for modulating nerve function are disclosed. An example method for modulating nerve function may include providing a transgene including a neuron-specific promoter and a gene encoding a light-sensitive protein, delivering the transgene to a body tissue including one or more target neurons, implanting a light source adjacent to the cell bodies of the one or more target neurons, and emitting light from the light source. Light may be exposed to the cell bodies of the one or more target neurons and may cause a conformational change in the light-sensitive protein.