We have melanin in our skin to block radiation from the sun. Now there's a difference. The sun is emitting thermal radiation of about a million degrees celcius. The energy profile of it's radiation is very well studied. It's basically random radiation with every individual photon being in a defined (and quite low) energy interval.
Radiation in space is totally random over the entire spectrum. There aren't many events at all (compared to the sun's radiation you could be forgiven for claiming there isn't any radiation in space at all, so few photons), but the events that do happen have a totally random energy distribution. Meaning most of the rays have enough energy to knock 2 or 3 molecules from the front of your finger into your brain. Or (a very tiny) part of the casing of the ship into deep into your body. If you measure space radiation with your sensor pointed down towards this massive rock we're living on, using the entire mass of the planet to block the radiation, the meter does not go down to zero (even when you eliminate the radiation produced by the planet itself).
Metals have a bit of an advantage blocking radiation because they have collective electron orbitals. If radiation impacts an electron inside a metal structure, it's going to throw it centimeters, meters away, maybe even kilometers. But here's the difference : that energy can be dissipated all around the structure. In other words, just because an electron gets an energy boost and gets thrown all around the room does not mean it has left it's orbital at all, and so it should remain inside the metal plate. If it does, the radiation is blocked. It's a sort of "structural integrity" field : the energy delivered does not have to beat the magnetic field of a single atom, but the magnetic field of the entire lattice. Unfortunately, on a per-atom basis, metal magnetic fields are on the very low side (mostly).
Ideally you'd use compressed plasma clouds to block radiation. But the energy required for maintaining that is rather enormous. But it would block pretty much all radiation (this is the reason the early universe, despite producing more photons in essentially empty space than the fusion reaction in the sun does today, was "completely dark". Those photons couldn't travel, so they'd never hit any sensor)
This is the problem with space radiation. Once radiation energy levels go above certain "reasonable" energy levels blocking it becomes a pipe dream.