Ethics questions concerning a referee assignment Asking this question here as it was suggested in one of the comments from MO.
I recently refereed a paper that I returned to the author(s) for revision. The thrust of their argument relied on a claim whose justification I felt was lacking. I dutifully raised the issue in my report and, in addition, I corrected another portion of their proof. I also obtained partial results on this problem from another paper (I initially raised the problem they purport to prove).
The author(s) have yet to revise their work and, in the interim, I came up with a justification for their claim. I now have a proof of this result (which is important for another paper I'm working on) and would like to publish it (at least obtain some level of attributionfor the correct proof).

What are the ethics/options here? Do I need to provide them with the correct proof? May I submit the result as my own? If so, must I wait until their revision before I submit my own paper? Should I disentangle myself from any further involvement as the referee?

EDIT: I’d like to add a little context to one of the points made in a response below.
The conjecture they purport to prove is one that I made in a previous paper which included partial results on the conjecture. Thus, I have thought about the problem and the “ownership” of the problem belongs to me.
However, it is clear that I wouldn’t have come up with the proof without their submission.
It seems to me that a co-authorship of some sort would be the best for all parties, or I simply pass along the proof to the author(s).
Publishing this result independently is questionable from an ethical perspective, especially because it sounds like: 

(1) you would not have been working on this problem without having read their manuscript as part of your refereeing duties;

(2) the result is your justification, but it is for their claim, which they thought of;

(3) you raised this issue in your referee report, and presumably the acceptance of their manuscript depends on addressing it (in other words, it is not just tangentially related to their work, but affects their publication in a significant way).

You clearly have not done anything unethical in thinking about the problem, and you should seek credit for solving it. However, their paper, and your interaction with them as an anonymous referee, cannot go unacknowledged. How would you feel if you submitted a paper, a revision was requested on the basis of XYZ issue, and while you are trying to figure out XYZ, you find the next week that a solution to XYZ has suddenly appeared in the literature? 

As for the appropriate resolution, that may depend on field and even journal. I recommend you contact the editor and explain what your situation. A reasonable compromise might be to publish this result in a separate paper collaboratively with the original authors (which obviously requires you to reveal your identity).