Unfortunately, lightsabers are not real. Like the Millennium Falcon and Yoda (and even Chitty Chitty Bang Bang, for that matter), lightsabers are a special effect that looks so real you actually believe they exist!
The technique used to create the lightsaber effect is pretty straightforward, but tedious. On the set, the actors use props composed of handles that have aluminum rods attached to them, and these rods are the length of the lightsaber "blade." The handles are plastic models and the aluminum rods are painted red or green or blue. The actors use these props as though they were lightsabers.
After the film is shot, it is taken to the special effects department. The film is developed normally. In this film, the actors look like they are fighting with painted broomsticks instead of lightsabers. A special effects artist now has the job of making those broomsticks look real. The artist looks at the film frame by frame, and projects each frame that contains a lightsaber onto a clear piece of plastic (an animation cel). The special effects artist draws the outline of each lightsaber blade in the frame onto the cel. Then, for each frame, the artist paints in the correct color for the blade using a bright cartoon color. Eventually the artist has a stack of these cels, one for each frame of the movie containing a lightsaber. The cels are clear everywhere except where the lightsaber blade is seen in each frame.
Now, a new piece of movie film is shot. On this film, each animation cel is placed over a black background and shot with a light diffuser over the lens (this diffuser gives the lightsabers the glow they have around the edges). If you were to play this film in a projector, all you would see is the lightsaber blades moving on a black background. Before it is developed, however, the actual footage from the movie is double-exposed onto this same film. The effect is amazing -- the lightsabers look incredibly bright and real!
As movies move further into the digital realm, the job of animating the lightsabers gets slightly easier, but not much. In a digital world, each frame of the movie is scanned into a computer at extremely high resolution so that each frame can be manipulated on a computer screen. To make the lightsabers look real, the special effects artist looks at each frame on the computer screen, outlines the broomsticks, colors the areas and diffuses them (frame by frame by frame...). Instead of being done on a plastic cel, it is all done on separate "cels" in the computer's memory and then merged digitally. However, there is no way to get around the fact that the animator must look at each frame and outline the lightsaber blades one by one.