Question: I am handling a paper as an associate editor that proposed an algorithm that I find to be weak. In fact, I was able to show that a very simple, brute-force approach actually has a better running time than their algorithm. Therefore, I will recommend rejecting this paper. Do I have an obligation to share my proof that the brute-force running time is better? I want the higher-level editors to have confidence in the rejection, but it also occurs to me that I might be able to improve my own result and publish it independently. Is this a violation of ethics?

UPDATE: Well this certainly took off! I would like to add the following:

* The overwhelming consensus is that it would be unethical for me to "scoop" the other authors, so I will not do that. The advice from all is greatly appreciated.
* The journal is the top in its field, so we have to be extremely selective. The problem proposed is fairly interesting, but overall the paper does not meet our threshold.
* When I say that brute force is better than their method, I mean it in a provable, big O sense.
* The authors' proposed scheme is not only inefficient, it is written in a very confusing way. In fact, I asked them to compare their approach to brute-force as a way of helping them clarify their argument, and they did a bad job of it, which is what led me to look into it in the first place.
* The fact that brute force performs better than their scheme is not totally trivial because it relies on a combinatorial argument that is not amazing, but not completely obvious either.
* I will share my proof with the Editor in chief, but I have decided not to give it to the authors; I will consider publishing independently in the future if their work ever appears elsewhere.
* Their paper is not on arXiv or any other website.

Answer: 
I think you are treading on thin ice, ethically speaking. Obviously you, as an editor, have no obligation to help the authors in any specific way, and you are free to tell them about your improvement or not, but rejecting their paper, taking the idea/problem, applying a different method to its resolution, and then publishing this under your own name seems problematic.

As an editor, you are usually expected to treat the papers you are handling as privileged information, and you are specifically expected to not use your knowledge of rejected papers to scoop the authors - which is exactly what you plan to do. Say you reject the paper with comments along the line "important problem, solution is too simplistic". The authors now go back to the drawing board, come up with a solution similar to what you had in mind, and get their paper accepted. If you publish your idea first they obviously can't do this anymore - you have effectively made use of knowledge you learned as an editor to pull the rug from under the people who initially thought of the research project, even if they did not do a great job with the first submission.

I understand that it sucks that if you told them about your idea you would be giving away information that, in different circumstances, may be sufficient for co-authorship. However, I would argue, as a reviewer / editor we *sign up for* helping the authors "for free" to some extent (that is, without expecting recognition).

If you really don't want to tell the authors about your idea your best hope is that the authors get their work accepted somewhere else. In that case you are free to write your follow-up paper and cite the original paper.
I think you have an obligation to academia to disprove his algorhithm with a brute force algorithm. Give your brute force proof to everybody and put it in the public domain. After you disprove it, if you have an algorithm that's better than his and better than brute force, you could offer to help him write a better algorithm. You and him can both be coauthors of the new paper with your new algorithm. Wait until everybody accepts that his original algorithm has been rejected before offering to coauthor with him the new algorithm. Tell him that you have a new, better algorithm, but don't tell him what it is until he agrees to coauthor with you in a written, signed document. That way, you get credit for helping, but are not taking away his idea. However, remember that some ideas are proposed in odd ways because of a need to avoid similar patents. An inefficient algorithm that is patentable is better than an efficient algorithm that looks like someone else's invention.