This semester I had a new experience: an M.A. student whose proposed project made me say, "Damn! I want to write that!"
I've had students write good papers before, of course; one or two I've even thought might be publishable. But this is the first time I've read a prospectus and thought, yeah! I've been noticing that, too! and this is totally the kind of work I might do and seriously: this has never been written about? because this needs to be written about.
As new as this experience is for me, it must be relatively common for others, especially those who work with doctoral students. Teaching always means seeding the ground a bit, training students to do the kind of work--focus on the issues, ask the questions, pursue the methodologies--that we find interesting. Combine that with very smart students and students engaged in long-term projects, and it makes sense that the intellectual current would flow both ways. Still, the ethical issues can get murky.
In my case, it's no big deal: my student's topic is a cool one, and something I might be interested in keeping on a back burner, but it's not meaningfully related to anything I'm doing right now and my front burners are full up. If my student delivers on the promise of the prospectus, then cool: I'll recommend transforming it into a thesis and/or a journal submission. If not (or if the student eventually writes a thesis on some other subject), then the ground is clear for me to work on this topic someday.
Other cases are more complicated. I have friends who've felt an uncomfortable frisson of recognition when reading the latest book of a former mentor. None of my friends were or felt themselves to have been robbed--but when a senior scholar produces work that arguably overlaps with or grows out of the work their students or juniors were working on years ago. . . well, I'm not sure who owes what to whom, but I'm pretty sure a gracious mention in the acknowledgments is a minimum.