Optogenetic approaches promise to revolutionize neuroscience by using light to manipulate neural activity in genetically or functionally defined neurons with millisecond precision. Harnessing the full potential of optogenetic tools, however, requires light to be targeted to the right neurons at the right time. Here we discuss some barriers and potential solutions to this problem. We review methods for targeting the expression of light-activatable molecules to specific cell types, under genetic, viral or activity-dependent control. Next we explore new ways to target light to individual neurons to allow their precise activation and inactivation. These techniques provide a precision in the temporal and spatial activation of neurons that was not achievable in previous experiments. In combination with simultaneous recording and imaging techniques, these strategies will allow us to mimic the natural activity patterns of neurons in vivo, enabling previously impossible 'dream experiments'.