ballistics_image_2.gif
Matching striations on a test fired bullet, and a bullet recovered from a crimescene, fired from the same gun.
Ballistic Fingerprinting

Identification of tool marks, striation markings and firing pin impressions all fall under the study of ballistic fingerprinting. This is one of the oldest types of forensic ballistics.
Firearms evidence traces back to England in 1835. A bullet mold belonging to a suspect was matched unique markings on a bullet taken from a victim, leading to a confession from the suspect.
In 1902, the first court case involving firearms evidence took place. Oliver Wendell Holmes (an American Jurist) used a magnifying glass to match the bullet found in the victim with a test bullet, fired from the alleged murder weapon into a wad of cotton. The test was deemed conclusive evidence that the gun was the murder weapon.
In a modern sense, ballistic fingerprinting can be separated in to different areas:

Gross Differences:

Gross differences refer to differences in the caliber of 2 bullets. For example, a 10mm bullet cannot be fired from a 9mm gun barrel.

Striations:

Striation markings occur on a bullet as it moves through a rifled barrel. Raised and lowered spirals (called rifling) help to 'spin' the bullet as it leaves the barrel. This helps improve aerodynamic stability and accuracy. Forensic specialists can identify markings on a bullet and attribute them to either as 'class characteristics' (common to all guns of a certain type) or 'individual characteristics' (markings unique to a particular gun, caused by imperfections in the gun barrel).

ballistics_image_5.gif
Casings with dissimilar firing pin impressions.
Firing Pin Impressions:

When a bullet is fired, it is struck from behind by the firing pin to detonate the primer. Slight imperfections or defects present on the firing pin mean it might have a unique shape or leave distinct markings. Further, a firing pin may not strike directly in the centre of the bullet. These markings can be very useful in matching a shell casing to the gun it was fired from.

Other Markings:

A number of other markings can be found on the shell casing, including marks from extractor mechanisms, breech face, and other such markings left on the case by imperfection in the firing mechanisms.

Sources:
Geocities: "Forensic significance of a tampered firearm", http://www.geocities.com/j_ksinha/tgun.htm (26/09/2009)
Images from http://www.geocities.com/j_ksinha/