Ghostwriting is when an author writes a work and attributes it to someone else.
Isn't this reverse-plagiarism (someone taking credit for someone else's work, but with permission)? I'm not sure it happens in academia a lot, but I've seen instances where a professor "ghostwrites" course notes for another professor. Actually those notes are really bad and it seems like he doesn't want to take the hit of delivering the course himself. Instead he ghostwrites it for other people. It seems wrong to me.
Unattributed work in academia is generally considered unethical. In my own experience, however, I believe that I've come across very few instances of actual ghostwriting where the real author was unnamed. Normally, at least some acknowledgment is called for, either in an editor's note or introduction.
Now, to answer Mankoff's comeent below, by "unattributed work," it can be okay for authors to choose to remain anonymous, if they feel it is in their best interests to do so. However, to take someone else's work and to pass it off as their own is clearly unethical behavior. However, from an ethics standpoint, even if the ghost author is asked about attribution and declines, the "named" author should not attempt to claim sole credit for the work. Instead, the author should make some sort of reference to those who assisted in the preparation of the manuscript. Otherwise, they're passing off someone else's work as their own.