have a light bulb go on in (one's) brain
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 brain about what we needed to do. Hey, I just had a light bulb go on in my brain—what if we try rerouting the funds through your sister's company to avoid higher tax rates?