This page illustrates a technique I have used for taking panoramas which include the sun.
Normally this results in significant flare and internal reflections in the lens:
You can't completely get rid of them and have the sun in the picture, but I've found that
you can get much better results by taking two images into the sun, one with your hand in
front of the lens covering the sun. The masking doesn't just get rid of the reflections: it
also greatly improves the contrast. Run the cursor over these images to see the difference,
or click (up to 3 times) to enlarge: