Most lenses are shipped with a dedicated hood. Its purpose is to diminish lens flare. Lens flare is caused by light rays hitting the lens elements diagonally. As a result, the shape of these elements appears in the final image. Sometimes lens flare is no so obvious; you may not see such shapes into the image, but you get a low contrast image. Because of their design, ultra wide angle lenses are prone to lens flare more than other lenses. It’s very difficult (almost impossible) to shoot into the sun with a wide angle lens and not to get lens flare. Sometimes you can use this “effect” creatively (in fact, Photoshop has a filter to add lens flare in post-processing), but most of the time you want to avoid it.
So what you can do to avoid lens flare?
1. Keep the lens hood on all the time, even in situations where no intense light is present. I see many photographers taking pictures with the lens hood reversed in storage position. I can’t believe you are so lazy to do so. It’s the best thing you can to do to decrease the contrast of your images! The only time when you want to remove the lens hood is when you are going to use your camera’s pop-up flash. Pop-up flashes are located just above the lens, so when they fire the lens hood causes a shade that is present in the final image.
2. If lens hood is not enough you can further up use your hands, cap or whatever you have available to block light rays from reaching the lens diagonally.
3. Avoid shooting directly into the sun/ light source or at near angles, especially if you are using a wide angle lens.