A threat roll is made when an attack roll hits and the natural (unmodified) roll is within the threat range of the weapon being used. This threat roll is made the same way as the original attack roll (with the same modifiers), except the threat roll does not automatically hit if a natural 20 is rolled, nor does it automatically miss if a natural 1 is rolled. (Plus, a threat roll cannot trigger another threat roll.) If the threat roll hits, then the original attack becomes a critical hit.
1) A level 5 fighter (BAB +5) with 18 strength (+4 to hit), Weapon Focus (+1 to hit), and a +1 longsword (+1 to hit, threat range 19-20, critical multiplier x2) is fighting a goblin with an AC of 16. The fighter has a total attack bonus of +11. If he rolls (on a d20) a 1 through 4, he misses the goblin, since adding 11 to the roll does not meet or exceed the goblin's AC. If he rolls a 5 through 18 he hits normally. If he rolls a 19 or 20 (within the threat range of his longsword), then he hits and a second roll is made. If the second roll is 4 or less, the hit is a normal hit, but if it is 5 or more (hence 16 or more after adding his attack bonus), the hit is critical and damage is rolled twice.
2) A level 10 rogue (BAB +7), with 14 strength (+2 to hit), weapon focus (+1 to hit) and a keen rapier (threat range 15-20, critical multiplier x2) is fighting a giant with an AC of 27. The rogue has a total attack bonus of +10. If he rolls a 1 through 16, he misses since adding 10 to the roll does not meet or exceed the giant's AC. (Note: even though rolls of 15 and 16 fall within the weapon's threat range, a threat roll is not triggered since the attack missed.) If he rolls a 17 through 20, he hits and a second roll is made. If the second roll is 16 or less, the hit is a normal hit, but if it is 17 or more, the hit is critical and damage (excluding any sneak attack damage) is rolled twice.