Optically gated ion channels were expressed in circumscribed groups of neurons in the Drosophila CNS so that broad illumination of flies evoked action potentials only in genetically designated target cells. Flies harboring the "phototriggers" in different sets of neurons responded to laser light with behaviors specific to the sites of phototrigger expression. Photostimulation of neurons in the giant fiber system elicited the characteristic escape behaviors of jumping, wing beating, and flight; photostimulation of dopaminergic neurons caused changes in locomotor activity and locomotor patterns. These responses reflected the direct optical activation of central neuronal targets rather than confounding visual input, as they persisted unabated in carriers of a mutation that eliminates phototransduction. Encodable phototriggers provide noninvasive control interfaces for studying the connectivity and dynamics of neural circuits, for assigning behavioral content to neurons and their activity patterns, and, potentially, for restoring information corrupted by injury or disease.