Why does the tail of the comet point away from the sun?

Basically, the solar wind - coming from the Sun - pushes particles from the comet outwards.