What causes lens flare?
A camera made for photography (this also goes for all other multi-glass-element lenses, which includes pretty much every lens you are likely to come across, except loupes, magnifying glasses and glasses) is built up from several glass elements.
These glass elements work together to focus the light that gets caught on its way into the lens, and gather it on the imaging chip or film.
Lenses are covered with an anti-reflective material. However, this material is not 100% effective, and some times, reflections inside the lens can be observed.
The more lens elements a lens has (typically anywhere between 3 and 20, usually around 6 or 7, depending on lens type), the more potential reflections.
When light shines into the lens on a particular angle so that the reflections become visible, there are usually several reflections at once. This is what is known as lens flare.
What makes lens flare worse?
Lens Elements: The more lens elements, the more possibility for reflections. In other words: Zoom lenses, and then especially cheap zoom lenses, like the ones that come with entry level SLR cameras, or the ones that are usually built into the less pricy compact cameras, are bad at making lens flare worse.
Number of aperture blades: Cheap lenses usually come with between four and six aperture blades. (very cheap cameras, such as the Lomo only have two, whereas expensive TLR or advanced SLR lenses might have up to twelve or sixteen. The shape of the lens flare is determined by these aperture blades. A six bladed aperture will have six sided polygonal flares and twelve spiked highlights.
Brightness of the light source. This one is obvious - the brighter your light source, the more chance of reflections. The less obvious part is that lens flares usually only happen of fast shutter times (less than 1/30 of a second shutter time). The sun, therefore, is the most common source for lens flares.
Film type. If you have ever pointed a cheap camcorder at a halogen spot, you will probably have seen how colour bands move either horizontally or vertically from the light source. This is due to the CCD technology used to capture the image. The same goes for most digital cameras in different forms, but also for certain types of film. This colour banding has nothing to do with the actual flare, but if you have a good film, it will "swallow" the colour bands, making the flare less visible. This also means that if you WANT a flare in your images, you should use a good film, so the colour banding does not occur.
Lens condition: Dust, scratches and other blemishes on the lens (including inside the camera and the quality of the glass of which the lens is made) all contribute towards more prominent lens flares.
How can you avoid lens flares?
The most obvious tip is to not take pictures towards the sun or other strong light sources. if you can see the sun in the picture, it is unavoidable some times. However, if you cannot see the sun in the picture, the use of a lens hood might significantly lessen the flares - in particular if you use a wide angle lens (i.e shorter than 30mm on 135 film cameras)
Other things you can try is to use a polarizer filter, and obviously do the opposite of the tips above - use good quality lenses, keep them absolutely spotless, and use good film.
To minimize the effect of the flares, use faster shutter times and wider apertures, so the flares at least come out perfectly round. Might look nice :)