Phototaxis behavior is commonly observed in animals with light-sensing organs. C. elegans, however, is generally believed to lack phototaxis, as this animal lives in darkness (soil) and does not possess eyes. Here, we found that light stimuli elicited negative phototaxis in C. elegans and that this behavior is important for survival. We identified a group of ciliary sensory neurons as candidate photoreceptor cells for mediating phototaxis. Furthermore, we found that light excited photoreceptor cells by evoking a depolarizing conductance carried by cyclic guanosine monophosphate (cGMP)-sensitive cyclic nucleotide-gated (CNG) channels, revealing a conservation in phototransduction between worms and vertebrates. These results identify a new sensory modality in C. elegans and suggest that animals living in dark environments without light-sensing organs may not be presumed to be light insensitive. We propose that urbilaterians, the last common ancestor of bilaterians, might have already evolved a visual system that employs CNG channels and the second messenger cGMP for phototransduction.