Why on my iphone does it sometimes show texts in green, and sometimes in red?

I have a iphone 4s, my son has iphone 5. Sometimes when i text him, the text appears in green, and sometimes it appears in blue. Does anyone know why this is?

The green ones are ordinary text messages, they cost money or will be taken from your monthly contract allowance.

The blue one is an iMessage. They are a form of text between iphones and are sent when both the sender and receiver are connected to the internet (either Wi-Fi or 3G/4G).

iMessages are free.