CROSS SOMEONE'S MIND - if something crosses your mind, you think of it, but often not for very long or very seriously
e.g. It suddenly crossed his mind that maybe Stephanie had been right.
STRIKE - if a thought or idea strikes you, it enters your mind suddenly or unexpectedly
e.g. He stopped speaking, struck by a sudden thought.
FLASH - if a thought flashes across your mind, it comes and goes very quickly
e.g. (flash across/through/into) The thought that I might die flashed through my mind.
TAKE IT INTO YOUR HEAD TO DO SMTH (idiom) - to suddenly decide to do something, often something silly or surprising:
e.g. Anyway, they took it into their heads to get married.
STUMBLE ACROSS/ ON/ ONTO/ UPON - to find or learn about (something) unexpectedly
e.g. He stumbled onto the truth.
COME/ POP INTO COMEONE'S HEAD (idiom) - become a thought that's not a result of reasoning
e.g. She always says the first thing that comes/pops into her head.
ENTER YOUR MIND/HEAD - if a thought enters your head, you think about it or consider it
e.g. Why such a bizarre notion should have entered her head I cannot imagine.
COME/SPRING/LEAP TO MIND - if something comes to mind, suddenly you remember it or start to think about it
e.g. They asked for my comments, but nothing sprang to mind.