For sunset or sunrise photos, you'll generally want a gradiated (graduated) neutral density filter (grad ND). A 2-stop is the bare minimal, and a 3 or 4 stop might be even better. On these filters, the top half is shaded (in the sunny area) and the bottom half is clear (in the shaded area) which has the effect of reducing the overall dynamic range of the scene and lets the digital sensor capture it better.
This was taken with a Nikon D80, the 18-55 kit lens, a 2-stop regular ND filter, and then a 2-stop grad ND filter double stacked. Without the grad ND I would have lost a ton of detail on the water and beach, which would have been a lot darker.
Now if you're talking about actual glare reducing the contrast of the photo, or other artifacts like flares or ghosting in your images, a lot of that can be lens specific. Generally the more complicated lenses are more prone to flare/ghost issues, and the simpler ones are less prone. A lens hood can help, but that'll only help if you're shooting away from the sun. Generally, filters won't help with flaring or ghosting issues from what I've seen, but might help reduce their intensity if you use stacked ND and grad-ND filters. The only lens I've ever had with any sort of a glare issue when pointed anywhere close to a light source was the Nikkor 35-70mm f/2.8D, which I promptly returned. The rest of my lenses seem to be fine.
I think that was 1/5s at f/8 or f/11 on a tripod and iso100. I had the 2-stop ND and 2-stop grad-ND on there to control the light so that I could maintain a slower shutter speed and get a little wave motion in the shot.