have a light bulb go on (in (one's) head)
To be suddenly struck with an ingenious or inspired idea, insight, or revelation. After nearly four hours trying to come up with a solution, I finally had a light bulb go on in my head about what we needed to do. Hey, I just had a light bulb go on—what if we try rerouting the funds through your sister's company to avoid higher tax rates?