This occurs when you try and write to a file that is currently being executed by the kernel, or execute a file that is currently open for writing.
The reason you can do this is that the kernel will not free the disk space used by the program until the last use of it is free'd, ie: the program exits. If the computer crashes and doesn't get a chance to free these, on a reboot fsck will usually complain about "deleted inode has zero dtime" (the inode was deleted, but never free'd because it was still in use at the time the program crashed). Unix can do this because it refers to a file by it's inode number, and it may have 0 or more filenames. Opening a file and then deleting it (and keeping hold of the filehandle) is a common way of using a temp file, since you know it will be removed from the disk when your program exits. Note that MicrosoftWindows cannot do this, since it refers to a file by name. Thus, you cannot remove a file that is in use in Windows.
8 pages link to ETXTBSY: