How did the sun get hit? She shot magic during the night, and it was literally tangential to earths surface. Even assuming it was perfectly east/west (technically this shouldn't be the direction you actually want, as the planet is on a tilted axis. It should be a good enough approx. to make my point, tho), the planet would have to have the sun a bit above the horizon for that magic blast to hit it, somewhere around dawn/dusk should do. Not absolute dark midnight.