The first guy in line says the color of the hat of the person in front of him. This is the only guy to not have a guaranteed chance of getting sent to heaven.
The next person says the color of the hat that the first person said, but yells the color if the person after him has a hat color different than his own. In contrast, if the next person in line has the same color hat as the person speaking, the person speaking merely says the color of his hat, given by the first person in line.
Example:
Person 1 - Red (Color of Person 2's hat)
Person 2 - RED (Yells, indicating that Person 3's hat is different)
Person 3 - Blue (Normal, indicating 4's hat is the same color)
Person 4 - Blue (Normal, indicating 5's hat is the same color)
Person 5 - BLUE (Yells, indicating 6's hat is a different color)
Person 6 - Red
Etc, etc