There is no device more failure prone these days than the unpredictable optical drive, whether CD or DVD. The average life is about a year, though some have been known to last five years.
Some drives have two, others three or four lasers. Some are drive by a wheel, others by a belt... which can wear and slip, or come off.
Usually the laser burns out. Sometimes, it merely slips a micron out of alignment. Other chips, diodes, capacitors burn out. They are made by machine for around $5.00 US so there is no quality control.
Sometimes the problem is merely a defective IDE or EIDE cable. Sometimes the jumper is incorrectly placed on the wrong pins.
If the drive is under warranty, replace it.
If not, replace it. CD-RW drives are available for $20 to $40 at Wal-Mart, Best Buy, Circuit City, Computer stores, and 87 locations online.
DVD Drives start at $39 and go up to $800, but the average is $44 to $49.
Easy to replace.
Be sure you have the correct one for your computer. Some are connected by 40 conductor EIDE, some are 80 conductor, 40 connector EIDE, while others are SATA cables.