Lens flare is the reflections in the lens that caused by the hit of direct light to the frontal element of lens. Lens flare reduces the contrast of the picture. It is often something unwanted in photography unless you use it for a reason intentionally.

A Lens Hood* is helpful to keep your lens in shade by avoiding direct light hits to your lens. If lens hood is not enough use your hand or a cap to avoid direct hits. You can cast shadows with your hand or any other object by placing that in front of your lens and above.

*“Lens Hood is a device used on the end of a lens to block the sun or other light source in order to prevent glare and lens flare.” Wikipedia