CR2 is an image file format written by some popular Canon digital cameras such as the EOS300d, EOS350d, EOS400d, Digital Rebel XT and Kiss n Digital. CR2 is a RAW format that supersedes the CRW format. RAW format means that the data is written to memory directly from the CCD or CMOS chip without any modification, processing or compression.
CR2 files usually contain vast quantities of information which is lost when saved as JPEG, the file size of a CR2 can be four times that of the equivalent highest quality JPG. The images are stored using the TIFF standards, with some improvement to the file structure and also includes full EXIF details.
Because of the extra information stored in CR2 files it is favoured in astrophotography because the very fine details of planets, nebulae and galaxies can be bought out in post processing. CR2 does not "throw away" any data so it's just a case of adjusting the curves in Photoshop to bring out the details in dust lanes or surface features. This extra information is very fine detail, or very faint detail. A photograph of a galaxy may not show anything but a few stars. It's not that the sensor hasn't captured the light, it just too faint to be visible. This faint detail would be lost if saving to JPEG, but it remains in CR2, it just takes some adjustment of the brightness and curves.
CR2 (or RAW files generally) also offer a greater flexibility when dealing with exposure times. An under exposed image can easily be increased in brightness/contrast without introducing noise or effecting the dynamic range, as can a over exposed image.
Canons own "Digital Photo Professional" is an excellent piece of software for post processing CR2 files. Using this software you can adjust the exposure, white balance and push the curves whilst preserving the extra information. You can then export to JPEG, TIFF or BMP for later use.
CR2 is also natively supported by Adobe Photoshop CS2 and above, as well as Adobe Camera Raw and Photoshop Elements.