Optogenetic techniques are used widely to perturb and interrogate neural circuits in behaving animals, but illumination can have additional effects, such as the activation of endogenous opsins in the retina. We found that illumination, delivered deep into the brain via an optical fiber, evoked a behavioral artifact in mice performing a visually guided discrimination task. Compared with blue (473 nm) and yellow (589 nm) illumination, red (640 nm) illumination evoked a greater behavioral artifact and more activity in the retina, the latter measured with electrical recordings. In the mouse, the sensitivity of retinal opsins declines steeply with wavelength across the visible spectrum, but propagation of light through brain tissue increases with wavelength. Our results suggest that poor retinal sensitivity to red light was overcome by relatively robust propagation of red light through brain tissue and stronger illumination of the retina by red than by blue or yellow light. Light adaptation of the retina, via an external source of illumination, suppressed retinal activation and the behavioral artifact without otherwise impacting behavioral performance. In summary, long wavelength optogenetic stimuli are particularly prone to evoke behavioral artifacts via activation of retinal opsins in the mouse, but light adaptation of the retina can provide a simple and effective mitigation of the artifact.