A little while ago we covered some of the main radiation based difficulties of sending people to Mars, and while the solar wind is generally not so troublesome, cosmic rays, which we are shielded from here on Earth, are both more dangerous and much harder to redirect or stop.
Generally we want the outer walls of our spacecraft to be pretty durable, both for airtightness, protection against space junk, and to help protect against the solar wind, which can be stopped by a pretty reasonable amount of shielding. However, as you build up your shield, cosmic rays will start to play a nastier role. While you certainly don’t want a cosmic ray to be able to pass straight through your spacecraft and hit your astronaut unhindered (they’re very energetic particles, the sort that bodies deal very badly with), when a cosmic ray hits a dense object like a wall, it doesn’t just bounce back the way it came from.
It creates a radiation cascade instead; what was one particle is now two, four, sixteen, and beyond, very rapidly, as the particle interacts with the dense material of the spacecraft wall. Sixteen slightly lower energy particles is mathematically worse than one high energy one, and a serious point of concern once we get out of the Earth’s magnetic shielding. So a very reasonable response is to ask if we can bring along our own magnetic shielding, to prevent the high energy cosmic rays from hitting the wall of the spacecraft in the first place. Theoretically, this should reduce the amount of radiation inside the spacecraft cabin, since it would reduce the number of cosmic rays that can make it all the way to the spacecraft shield. The main reason this is impractical right now is simply a logistical one - we don’t have a good way to build a generator for a sufficiently strong magnetic field which is also lightweight enough not to be hard to launch.
Setting up waystations would be an interesting way of approaching the same challenge. If there were a fixed orbital path between the Earth and Mars, and we could build a magnetic tube between the two planets, you could do away with the need to have an onboard magnetic bubble. Because you’re not trying to launch them on the spacecraft, you wouldn’t need to worry about the weight as much, but the magnetic field you’d have to generate would need to be much larger, to guarantee that the spacecraft (within errors) would definitely travel safely through the buffered region. The distances involved here are vast, and so setting up a series of waypoints would almost definitely be unfavorable, at least from an energy consumption perspective. There’s also the question of fueling those waypoints. Are they solar powered? Fission powered? What happens if their solar panels break down or they run out of energy? They’d also have to be able to correct their own orbits in order to be in the right places for the protection of the traversing spacecraft, and at this point we’re looking at a giant electromagnet with rockets, which is a great sounding device to have, but practically speaking, it’s a more powerful version of what we’d like to have on the spacecraft in the first place, and if we can get by with one device instead of several hundred, one is probably better.