One way to shield a habitat in outer space from cosmic rays is with an absorbing blanket of some kind, which would function much like the atmosphere that protects the Earth. Speculate on second way for shielding the habitar that would also be similar to the Earth's natural shielding