Reef-building corals rely on the photosynthetic products of zooxanthellae for the majority of their nutrients. However, corals also capture zooplankton for food. Corals are suspension feeders. Nematocysts on the tentacles and mesentarial filaments can be used to sting prey and move it into the mouth. Some corals will trap prey in sticky mucus on their tentacles and move the prey into the mouth using the mucus and cilia.
Most corals feed at night.
This may be because night is when the zooplankton travel into the water column and become available for capture. Keeping the tentacles retracted during the day may also help corals avoid predation, protect themselves from UV light, and avoid shading their zooxanthellae.