There are multiple fixes for this problem, but before I prescribe solutions that require the use of tools, let me inform you of those that require pressing key combinations while the computer is running or booting up (courtesy Macrumors and some other sources on the web):
- Drag its icon to the Trash can in the Dock or select 'Eject' from the File menu.
- Go to System/Libary/CoreServices/Menu Extras/ and select Eject.menu. Use the entry for your DVD in this Menu to eject the drive.
- If you are running a virtual machine, e.g. VMFusion, ensure that the CD is disconnected from the virtual machine. This will sometimes allow the CD to now show up in Mac OS X.
- Hold down the Trackpad button while the machine reboots. Holding down an external Mouse button will not work. This may take some time, but keep your finger on the mouse button right up until the disc comes out or the log-in screen has appeared.
- Sometimes you can successfully use the eject disc button in iTunes even if the disc is not visible to the Finder
- Open Disk Utility and choose the disc you wish to eject in the left-hand pane, then click on the Eject button.
- If your Mac's drive has a paperclip hole, insert a straightened paperclip into, manually triggering the eject mechanism.
- Open Terminal and type "drutil tray eject" to eject the disc/tray, and "drutil tray close" to close the tray.
- If you have a G4 Powerbook, restart the computer while holding down Command-Option-O-F, to enter the Open Firmware prompt. Type "eject cd" without the quotes, and press return. The disk ought to eject. To start into OS X, type "mac-boot" without the quotes. Press return, and the computer will continue with the startup.
- If your computer has an eject button on the keyboard, restart the computer holding down the Option key. When the startup disk selection screen appears, let go of the option key and press the keyboard's eject button.
If none of these worked for you, here is the solution that is almost guaranteed to work: Simple Blade Fix.
If this doesn't work for you, try this solution Trial and Error Fix.