An eyespot is a simple organ in biology used to detect light. It may be called an ocellus, or pigment pit. They are quite common in small, simple invertebrates, such as Planaria. They do not have lenses or any means of focussing. Therefore, they can sense light from dark, but do not give the animal a visual scene as our eyes do.
In many simple animals the eyespot senses light with a pigment molecule called an opsin. Then a nerve fibre goes from the eyespot to the simple nervous system. This allows the animal to move in response to (for example) a shadow passing over it.
Eyespots also occur in single-celled protists like Euglena and Chlamydomonas, where it is connected to the flagellum. This allows the information from the light patch to influence the cells's movement.
The first fossils of eyes that have been found to date are from the early Cambrian period (about 540 million years ago). This period saw a burst of apparently rapid evolution, called the "Cambrian explosion". One idea is that the evolution of eyes started an arms race which led to a rapid spate of evolution. Much earlier than this organisms would have used light spots for light sensitivity, but did not have a visual scene for rapid navigation.
Eyespot Facts for Kids. Kiddle Encyclopedia.