In their classic experiments, Olds and Milner showed that rats learn to lever press to receive an electric stimulus in specific brain regions. This led to the identification of mammalian reward centers. Our interest in defining the neuronal substrates of reward perception in the fruit fly Drosophila melanogaster prompted us to develop a simpler experimental approach wherein flies could implement behavior that induces self-stimulation of specific neurons in their brains. The high-throughput assay employs optogenetic activation of neurons when the fly occupies a specific area of a behavioral chamber, and the flies' preferential occupation of this area reflects their choosing to experience optogenetic stimulation. Flies in which neuropeptide F (NPF) neurons are activated display preference for the illuminated side of the chamber. We show that optogenetic activation of NPF neuron is rewarding in olfactory conditioning experiments and that the preference for NPF neuron activation is dependent on NPF signaling. Finally, we identify a small subset of NPF-expressing neurons located in the dorsomedial posterior brain that are sufficient to elicit preference in our assay. This assay provides the means for carrying out unbiased screens to map reward neurons in flies.