He seized at the first words that came into his mind.
He uttered the first thing that came to him.