Background
I have a spacecraft traveling from one planet to another, say from Earth to Venus. The journey will take at the least several weeks. During this time, the sun will emit a number of solar flares that can cause detrimental damage to a spacecraft's electrical equipment (as well as giving astronauts ionising radition - increasing the chance of cancer and radiation burns.)
How would I ensure that solar flares and other matter from the sun does not damage or otherwise affect the spacecraft and its crew?