Shielding can be used to some extent. A Faraday cage, an underground bunker... can do wonders. Usually, the power grid will suffer most from a solar flare, because it is all unshielded obsolete under-maintained hardware, stretched to the max and beyond by competing regulations and market forces, and more often than not plain incompetence. So you first defence against a solar flare is an UPS.
Ultimately, protection against solar flares is similar to protection against the EMP from a nuclear blast, which is discussed in this previous question. Solar flares have the special characteristic of hitting a whole hemisphere at a time (the "day" half of the Earth), so if you want to maintain critical infrastructure through redundancy, then you have to spread it all around the World, literally.
Even more ultimately, if the solar flare is big enough, then we are all dead, and the question becomes moot.