For a split second Harry thought he had done magic without meaning to, despite the fact that he'd been resisting as hard as he could—then his reason caught up with his senses—he didn't have the power to turn off the stars. He turned his head this way and that, trying to see something, but the darkness pressed on his eyes like a weightless veil.
Harry Potter and the Order of the Phoenix
I am not sure about the meaning of "his reason caught up with his senses". I think it probably means: Harry's reason became as realistic as his senses, that is, he got it reasonably now(he didn't have the power to turn off the stars). How should we understand it if my understanding is wrong?