CD-ROM drives are probably the most life-limited components on these computers.
Sometimes the laser LED just fails. If you tried several CDs with the same result that would seem to be the problem.
Fortunately they are not expensive to replace.
Is the drive recognized if you go to > About this Mac and select More Info? System Profile would show it under "disk burning". If it does not appear the problem is obvious, but it cannot detect a failed laser LED.