
I really wish the remaining books would be turn into movies and so the Clarke-Baxter' A Time Odyssey series.
There are also three other novels under "A Time Odyssey". Separate story but with similarities <spoiler>mysterious outsiders and fascinating human-made AIs</spoiler.
A. C. Clarke and S. Baxter A Time Odyssey series 2nd book, "Sunstorm" focuses on destructive coronal mass ejection as main plot. One of the mankind solutions is a megaproject of shield modelled on Fresnel lens that is constructed on the Moon from regolith and shot up from electromagnetic slingshot in parts, which are then "mounted up" along with AI controlled mechanism in Lagrange point 1 in order to protect the planet.
It's of course a sci-fi portrayal of idea you mention and in this book humanity has a serious reason to build up this shield. As for reality, I can't tell if such structure build with current technology (a solar sail material most likely) would do anything - we doesn't seem to be bothered with global warming enough in first place.