Give yourself a moment to think. No one expects on-the-spot genius. And even the briefest delaying tactic (“Huh, I’ve never thought of it that way, but you’re right: that could be an interesting approach. Let me begin to answer by …”) can give your brain a chance to process the question.
Ask the questioner to elaborate on their question. A well-meaning question is an invitation, not a test. Take some time to examine the question with your questioner ("Can you clarify your question?"). A question is itself an example of thinking out loud, and they may appreciate getting another chance to frame it properly. They may have an example or comparison in mind they have not revealed (“That’s interesting; what made you think of that?”). Or there may be a question behind the question (“Have you been working on a related project that inspired your question?”).
Acknowledge the limits of your own research and knowledge. No scholar has enough time to explore every nook and cranny of their subject. It is fine to be more interested in some things than others (“That wasn’t where I focused my research. I was more interested in …”). But it is also wise to accept questions that point out your limitations for the gift that they are (“Why, no, I didn’t come across that information/writer/approach in my research. Tell me more.”)