Everytime I see one of my photography students with the lens hood on backwards, I know they don't know what the lens hood does. The lens hood is designed to reduce flare and protect the lens, among other things.
What is the purpose of a lens hood?
The lens hood is a piece of plastic that clips onto the front of a camera lens and extends beyond it. Lens hoods serve two primary purposes: (1) reducing lens flare, and (2) protecting the lens from damage. The intended purpose of the lens hood is simply to reduce lens flare, but the protection it provides to the glass elements of the lens is a beneficial side-effect.
Why are many lens hoods shaped so funny?
What you're probably referring to is the shape of what is called a “petal lens hood.” The shape of a petal lens hood allows it to extend as far as possible beyond the lens without showing up in the frame. Lenses are circular, but the pictures we take are rectangular. If these petal lens hoods were perfectly round, the corners of the hood would be in the picture. The only thing worse than getting a lens hood in the picture is when you hand your point and shoot to Uncle Harry, who puts his finger right over the lens when he takes a picture… ugh!
But not all lens hoods are petal lens hoods. Some lens hoods are completely enclosed without the weird cut-out shape. This type of lens hood is called a “round lens hood.” Prime lenses have round lens hoods more often than zooms, because they don't have the added difficulty of keeping out of the way as the camera zooms out.
Should I use a lens hood on my camera?
The short answer is yes. I almost always have a lens hood on my camera. While shooting without a lens hood can still produce great pictures most of the time, if any light happens to bounce into the lens from the sides, the contrast and color in the image is significantly reduced. Also, it is nice to have a lens hood for protection of the lens.
However, there are some lenses on which a lens hood is simply unnecessary. I recently saw one of my photography students with a lens hood on his 50mm f/1.8 prime lens. It looked quite strange because most people don't use a hood on that lens. The reason is that the plastic on the lens already extends behind the glass of the lens, so the glass is recessed. Therefore, the lens itself acts as a lens hood. There is nothing wrong with using a lens hood on such a lens, but it is hardly necessary in most situations.
Do lenses come with a lens hood, or do I need to buy one?
Some lenses come with the hood, and others do not. Canon generally provides a lens hood for the L series (professional) lenses, but not for the consumer level lenses. For those lenses, you'll need to head on over to Amazon.com and buy one for around $20.
If you are either really cheap or just love doing things yourself, you can actually make a lens hood by going to this website and following the directions.