How to tell a Prof you are no longer applying to a PhD program at his university? I am about to apply to Computer Science PhD programs to start Fall 2018. In the process of researching programs I have met with many Profs in fields I was interested in to (a) learn more about their research/fields (b) see if they were likely to be taking PhD students in the Fall. Having done this I now have a better idea of what I am interested in. As such, I've decided not to apply to one of the universities of one of the Professors I met, as I don't think it's the research area I'm most interested in (even though he is very distinguished in his field and at a prestigious university).

Even still, the area the Professor works in has some overlap with the area I plan to do my PhD in. So even though I don't want to apply to work under him, I will likely run into him again. And if an appropriate topic came up, it would be interesting to collaborate with him at some point on the future. 

So I'm wondering what is a sensible, professionally-appropriate way of sending him an email to say that I'm not applying to the program at that university because I've decided it's not the research area I'm most interested in, but I would like to stay in contact? Partly, I feel like it would be kind of awkward to run into him one day and have him think, "Oh yes... you're the guy who said he was interested in applying to work with us and then we never heard from again."
It can be hard to get a PhD position, as there are often only few positions but many candidates. Therefore, it is not uncommon to apply to more than one and the professor should be familiar with people finding a position elsewhere.
Telling him as soon as you made up your mind is the right choice, as this gives him the chance to look for other candidates. Thus, I would be honest with him and tell him what you wrote in your question.
As long as you are friendly and honest, there should be no problem. The only thing to remember is that professors are mostly busy people, so don't steal his time (e.g. by changing your mind in 2 weeks and wanting to work under him again...).