I am sometimes asked about the anonymous nature of peer reviewing, whether this is always or sometimes maintained, whether to reveal the names of reviewers to authors, and related issues. I just responded to one such request, and below is my slightly edited reply. A colleague was in the processes of reviewing a manuscript for a journal when the paper's author asked the colleague to participate in a symposium related to the topic of the paper. The reviewer saw some holes in the paper's argument, but basically seemed to like the paper and was going to recommend publication. This person was wondering whether to reveal their identity to the author. Here was my reply:
Some journals and agencies take a very hard line on anonymity in peer review, offering lots of warnings not to violate anonymity. In my experience this is more common with grant reviews than with journals, although I've seen it with both. But if that is NOT the case, I would do whatever seems most comfortable to you. In archaeology, reviewers sometimes sign their reviews and send copies of the review directly to the author. I do this sometimes. It can help the author in doing revisions by getting the review quicker, and it establishes a professional collaboration between author and reviewer, always a good thing. Scholarly production, whether books, journal articles, grants, whatever - is ALWAYS a collaboration between individuals (authors, reviewers, editors, administrators), and collaboration is almost always more valuable and more enjoyable if it is open and frank.
Sometimes sending a review to an author starts an email conversation. And one time, after a reviewer me sent their review of a paper of mine, the journal lost the reviews (!), and I ended up forwarding the review to the journal! But I'm sure XXX is much more efficient than the journal I'm referring to!
In a case like the one you describe I would consider things like: what is the best solution to advance scholarship and the discipline? What is most helpful to the other person? How helpful is it to come clean about reviewing a manuscript (helpful to personal relationships, helpful for scholarship, careers, etc.).
Personally I believe strongly in openness, so I'd probably let them know you are a reviewer. Although I often sign reviews, I don't always do this. I may refrain from signing a review if it is a bad paper/proposal by a friend or colleague and I'm not anxious for them to know I am panning it.
In sum, I think the important issue here is collaboration. Although the main purpose of peer review is to serve as a gatekeeper to main quality of published papers, another purpose is to stimulate collaboration between the reviewers and author. The goal of that collaboration is to improve the quality of published work, thereby benefiting scholarship in general. Students sometimes look at reviewers as mean people whose goal is to reduce the number of papers that are published. But it is more realistic and beneficial to look at reviewers (and editors) as collaborators who want to help you improve your paper. And if one knows their names, this can benefit additional and other kinds of collaboration.
If you want to read more in peer review, try some of these sources:
2007 Peer Review: The Challenges for the Humanities and Social Sciences. The British Academy, London. http://www.britac.ac.uk/reports/peer-review/report.pdf.
Chubin, Daryl E. and Edward J. Hackett
2005 Peer Review. In Encyclopedia of Science, Technology, and Ethics, edited by Carl Mitcham, pp. 1390-1394. Macmillan, New York.
Lanata, José Luis, Mark Aldenderfer, and Michael A. Jochim
2007 The Peer-Review Process for American Antiquity and Latin American Antiquity. SAA Archaeological Record January 2007:12-15.
Odlyzko, A. M.
2003 Peer Review and Non-Peer Review. In Peer Review in the Health Sciences, edited by F. Godlee and T. Jefferson, pp. 309-311. 2nd ed. BMJ Books.
2007 Open Access Overview (focusing on open access to peer-reviewed research articles and their preprints). http://www.earlham.edu/~peters/fos/overview.htm.