Data on a regular CD is stored by making pits (holes), or not-holes (lands), on the CD medium. The pits disturb the reflection of light. Transition from a 0
to a 1
or vice versa is determined by the start or end of a pit (this is called NRZI encoding). There is further complication as these bits are the "channel code", not the content bits; the latter are recovered by decoding the former. And then some of the "content" bits are really Error Correction Code bits. But ultimately, the bits are encoded via holes or not-holes in a reflective layer of metal, usually aluminum.
A CD-R works somewhat the same. It has a reflective surface, but this surface is covered by a dye. You can use a relative high intensity LASER to heat up the dye layer and turn it opaque. Afterwards the CD-R can be read in the same was as a normal CD. Light is either reflected or not.
CD-RW's work in the same way, but use a paint which can be turned opaque or not depending on the heat of the LASER.
Unlike the dye in CD-RW's, the Dye in a CD-R can not be reverted to its previous state. This is what prevents rewriting to an already written CD-R.
Note: Rewriting with the same image or a image with only the right bit changed would seem to be technically possible, but there are limits as to what could be done. The best you could do would be to burn a "pit" in the middle of a long "land". Since lands have a maximum length of ten bit-times, and both pits and lands have a minimum length of three, this would only be possible where an existing land was nine or ten bits long, and the only possibility would be a pit three or four bits long. Doing this would add two bit flips, and this in turn would necessitate changing ECC bits at other places in the same block. The chances that every such change could be done by adding a pit in the middle of a land are very, very small, even if there was software or drive firmware that would allow the attempt.
2CD's work much like the vinyl records of old. They don't rely on magnets, the laser actually etches pits and grooves into the CD data layer, which represent's 0's and 1's. – Kruug – 2013-01-08T21:46:25.690
2
Howstuffworks.com: http://www.howstuffworks.com/cd-burner5.htm
– user142485 – 2013-01-08T21:53:31.517@Kruug: Mmmh. In that case, why is a CD-RW rewritable? Curious – Ariane – 2013-01-08T21:53:55.420
6It does not etch holes. It changes the dye. Holes/bumps are only for pressed CDs. – Hennes – 2013-01-08T21:56:09.353