cross your mindvenir a la mente; pasar por la cabeza
As I got off the bus, the thought crossed my mind...