I've definitely been in the presence of absolute geniuses who knew my area of expertise way better than me before ;) I can relate to that feeling. I don't have any one particular person or situation in mind, but I'll share my answer:
One answer: Never let them know you think they are wrong, but try to find a way to educate them, or learn (more like re-learn) the lessons you already know in a way that they can also witness and experience.
I see this one all the time in graphic design circles, where designers sit around telling stories about the dumbest, most demanding clients and laugh at how little they knew about stuff, but to me that's a failure in communication. There's a gap there, and I think at least 50% of the responsibility for bridging that gap is from you, the actual trusted expert.
Ever since I realized that in my own client relationships I haven't had any of those 'nightmare clients', and I don't think it's because they went away, I think over time you (can) learn how to bring them up to speed, and share your understanding with them to help them see the same things from your perspective. But that's not instantaneous, and it isn't always effortless. Sometimes it's easy to explain something (like here's why 'above the fold' is a concept that doesn't apply to web design) and sometimes you almost have to establish a base vocabulary for the concepts you're talking about and teach them how to think and speak about something before you can explain what you know about it.
In the end, I believe most 'nightmare clients' can become slightly smarter, slightly better, and hopefully learn to trust your judgement more. The more you teach them and guide them, the more they will listen to what you have to say when it's time to give personal opinions on things.