When a baby tooth changes color, it can mean many things. Baby teeth can and do normally change in color, particularly close to the time that they become loose; however, this change is minimal and should not be confused with a carious lesion (cavity).
The best way to determine if your child has a stain or a true cavity is to take him or her to a pediatric dentist.
Caries is an infectious disease; it progresses if left untreated, and usually is associated with pain (especially when the cavities are large). Teeth with cavities typically assume a darker (brown) discoloration; and depending on the extent, may exhibit loss of tooth structure.
Teeth that have been previously "bumped" may also change in color. Traumatized baby teeth can assume a yellow or a dark discoloration, which may or may not be associated with pain.
Other less common causes of changes in color may be: fluorosis, food staining (particularly tea or colas), systemic disease (hepatitis), etc.