What would you do/have you done in such a situation? 


1. Hand out the improvement for free in your report
2. Wait until the result is published and then submit elsewhere
3. Inform the editor about the situation and ask for advice


The paper is not posted publicly so contacting the authors directly informing them and asking what they want to do is out of the question.



What to do if you notice a substantial improvement to a result in a paper whilst refereeing it?
Option (1) is definitely the professional course of action in this case. As pointed out in the remarks, it is likely to lead to an offer of co-authorship from the original author, but that is purely within the author's discretion. If you feel that your improvement is really substantial and you are worried about credit you can try to increase the chances of co-authorship by asking the editor to put you in contact with the author (after explaining the situation to the editor). You may then discuss this with the author directly and suggest co-authorship, a situation in which the author is more likely to accept (but they still may insist to refuse, in which case you should give them the idea "for free"). If your improvement is sufficiently significant and novel that not getting credit for it seems an unacceptable injustice, then what you can do is wait for the paper to be published (or accepted and online) and then write to the author with your idea of improvement and suggest co-authorship for a second paper. Here of course if they refuse you can publish alone. In any case, you should not submit your own paper without giving the original author a chance of co-authorship. That would be rather unprofessional.


