From the SRD:
Concentration
To cast a spell, the character must concentrate. If something interrupts the character's concentration while the character is casting, the character must make a Concentration check or lose the spell. The more distracting the interruption and the higher the level of the spell the character is trying to cast, the higher the DC is. (The DC depends partly on the spell level because more powerful spells require more mental effort.) If the character fails the check, the character loses the spell just as if the character had cast it to no effect.
Injury: Getting hurt or being affected by hostile magic while trying to cast a spell can break the character's concentration and ruin a spell. If while trying to cast a spell the character takes damage, fail a saving throw, or are otherwise successfully assaulted, the character must make a Concentration check. The DC is 10 + points of damage taken + the level of the spell the character is casting. If the character fails the check, the character loses the spell without effect. The interrupting event strikes during spellcasting if it comes between when the character starts and completes a spell (for a spell with a casting time of 1 full round or more) or if it comes in response to the character casting the spell (such as an attack of opportunity provoked by the spell or a contingent attack, such as a readied action).
If the character is taking continuous damage, half the damage is considered to take place while the character is casting a spell. the character must make a Concentration check (DC 10 + one-half the damage that the continuous source last dealt + the level of the spell the character is casting). If the last damage dealt was the last damage that the effect could deal, then the damage is over, and it does not distract the character. Repeated damage, does not count as continuous damage.
Spell: If the character is affected by a spell while attempting to cast a spell, the character must make a Concentration check or lose the spell being cast. If the spell affecting the character deals damage, the DC of the Concentration check is 10 + points of damage + the level of the spell the character is casting. If the spell interferes with the character or distracts the character in some other way, the DC is the spell's saving throw DC + the level of the spell the character is casting. For spells with no saving throw, it's the DC that the spell's saving throw would have if it did allow a saving throw.
Grappling or Pinned: The only spells the character can cast while grappling or pinned are those without somatic components and whose material components (if any) the character has in hand. Even so, the character must make a Concentration check (DC 20 + the level of the spell the character is casting) or lose the spell.
Vigorous Motion: If the character is riding on a moving mount, taking a bouncy ride in a wagon, on a small boat in rough water, belowdecks in a storm-tossed ship, or simply being jostled in a similar fashion, the character must make a Concentration check (DC 10 + the level of the spell the character is casting) or lose the spell.
Violent Motion: If the character is on a galloping horse, taking a very rough ride in a wagon, on a small boat in rapids or in a storm, on deck in a storm-tossed ship, or being tossed roughly about in a similar fashion, the character must make a Concentration check (DC 15 + the level of the spell the character is casting) or lose the spell.
Violent Weather: If the character is in a high wind carrying blinding rain or sleet, the DC is 5 + the level of the spell the character is casting. If the character is in wind-driven hail, dust, or debris, the DC is 10 + the level of the spell the character is casting. The character loses the spell if the character fails the Concentration check. If the weather is caused by a spell, use the rules in the Spell subsection above.
Casting Defensively: If the character wants to cast a spell without provoking any attacks of opportunity, the character needs to dodge and weave. The character must make a Concentration check (DC 15 + the level of the spell the character is casting) to succeed. The character loses the spell if the character fails.
Entangled: If the character wants to cast a spell while entangled, the character must make a Concentration check (DC 15) to cast the spell. the character loses the spell if the character fails.