A great idea suddenly struck her.

Literal

She [topic-は] suddenly great-idea [object-を] hit-upon.

ふと is a versatile adverb covering 'suddenly, casually, by chance, on a whim' — the moment when something pops into your head without being sought. It pairs naturally with verbs of cognition: ふと思う ('the thought crossed my mind'), ふと気づく ('happen to notice'), ふと見上げる ('happen to look up'). 思いつく ('hit upon, come up with') is a transparent compound of 思う ('think') + つく (here in the sense 'attach, alight on') — the idea 'lands' in one's thoughts. 名案, written with 名 ('excellent, famous') + 案 ('plan, idea'), means a brilliant idea or capital plan; the pattern 名~ ('an excellent X') gives related words like 名作 ('masterpiece') and 名手 ('master craftsman, virtuoso').