If you're getting this problem, most of the time it means that you need to replace the optical drive. If you have AppleCare, take the machine into an Apple Store or another Apple Authorized Service Provider and have them replace it for you free of charge. Otherwise, if the machine's out of warranty, I would buy an external drive since it'll cost 250+ to replace the internal drive, depending on what machine you have.