In space (within the Solar system), you will get mostly two types of "radiation" that have health consequences:
- Photons of various energy, from long wave radio to gamma rays.
- High-energy charged particles, mostly electrons and protons ejected from the Sun upper atmosphere (this is known as the solar wind).
Main source for these is, of course, the Sun. Photons, being electrically neutral, totally laugh at magnetic fields; a "magnetic barrier" will work only for charged particles. We know what UV can do to human skin despite an atmosphere, so one can imagine that some extra shielding will be needed in space.
Assuming that you have superconductors, you can maintain a powerful magnetic field for indefinite times, with energy being consumed only when a particle is indeed deflected. The shape and position of this field requires some care, though. For instance, the Earth magnetic field is not very good at protecting the Earth from solar wind; instead, it just moves around the impact point: high energy particles concentrate on polar regions, producing beautiful auroras. An awful lot of research on the subject of optimal magnetic shielding for spaceships is referenced from this page.
An aggravating circumstance of radiations in space is that it does not occur with a continuous flow; instead, it comes in bursts of considerable intensity, when solar flares occur. A good space shielding will be utter overkill most of the time, but will occasionally become an absolute necessity to avoid the crew being, well, killed over. A mitigating characteristic, though, is that the source position is well known (the Sun tends to be highly visible) and flares can be observed "visually" some hours before the onslaught of high-energy particles, giving time to raise extra shields.
Outside of the solar system, things change quite a bit. The solar wind actually creates a kind of "bubble" around the Sun, called the heliosphere, which acts a bit like a magnetic shield against the rest of the Universe. On the border of the heliosphere is a rather confused situation about which much is theorized but little is known; the Voyager 1 probe is currently moving through it. Beyond, there is not much to fear about solar wind, but a lot more about other high energy particles of many types, collectively known as cosmic rays.
We don't really know where cosmic rays come from, but the sources appear to be multiple. For our present discussion, this means that cosmic rays don't come from a unique predictable direction, and happen at seemingly random times, so shields of any kind must be up at all times. Moreover, not all of these particles are charged, so magnetic shields won't be enough.
Note that cosmic rays are also a problem within the solar system, even close to the Earth, but leaving the heliosphere increases the issue dramatically.
An extra hazard is beautifully exposed in Arthur C. Clarke's "The Songs of Distant Earth". If you are outside of the heliosphere, then you are traveling to the stars -- so you must be traveling fast, because stars are far, far away. This implies that low-energy particles or bigger fragments (e.g. stray atoms or molecules from nebulae) will have a high relative speed, and the repeated impacts will be damaging for the ship and its inhabitants. In the book, they add a big layer of ice in front of the ship, and must renew it regularly.
As for materials for more tangible shields (which will protect from neutral particles as well), a good candidate is not lead, but water. Water has a very good ratio of absorbing power per weight; also, water has other uses that lead does not offer, such as bathing, watering plants, raising fishes (tilapias offer a lot of protein while requiring only limited amounts of swimming space), and, come what may, even drinking, should the onboard stocks of decent beverages become depleted.
A popular design is a space ship as a big tumbling cylinder, creating "artificial gravity". The "ground" (the cylinder surface, from the inside) can be a big pool, and habitats would then be floating, like fish farms. The water maintains the inner ecosystem and provides excellent radiation shielding at the same time. Astronauts double as sailors.
Other possible materials include various polymers, gold (used for lunar modules on Apollo missions -- when you go to the Moon, you do it with style), and even "biological waste" from the crew. This whole radiation issue is still one of the unsolved problems for the trip to Mars, so that's an active research area.