If I saw a research result similar to mine from my PC/editing duties, should and how should I contact the authors? It happened many times that I saw a paper submitted to a conference where I am on the PC, or a journal where I am editing, and such paper had something similar to what I am working on. The situation is worse when I already have something better.

Of course I should declare a conflict of interest and should let others handle the paper. But I always wonder whether I should contact the authors.


If I don't contact the authors, they might doubt the independence of my paper from theirs when I publish my paper (since my name is shown in the conference/journal they submitted their paper to). This will be worse if their paper was not published at that point (perhaps it got rejected several times).
If I do contact the them, they may feel that I push them to do something they don't want to, such as making their paper public or collaborating with me.


There are more pros and cons, but I will stop here to keep the question short.
If you have already read the paper, do not contact the authors. Here's why: 


You would have to admit to them you read the paper. Since that is a conflict of interest (and you should have recused yourself), you would essentially be outing yourself and the journal for less than ethical reviewing.
You would be providing an incomplete opinion on their results. Your paper hasn't been published yet, so you don't know for a fact that your results/contribution are considered more valuable than theirs. Telling them of your research may sway them to continue or abandon their work unfairly. 


Going forward, make sure to recuse yourself from editing before you read the paper. When the editor/assigner emails you about the assignment, make sure to read the abstract thoroughly. If one is not provided, email back and ask for one. If the abstract suggests a line of research that appears close to yours, recuse yourself at that point -- before reading the full submission. If you have any doubts about how close it is, I would recuse myself anyway. Most editors appreciate this.