An ostrich doesn't actually stick its head in the sand. It just ducks down when it detects danger, usually in high grassy areas. I didn't know this myself until last year when I read it in a book for my 3rd grade students.
For a grown-up answer, here's a copy and paste job from Wickepedia:
"In popular mythology, the ostrich is famous for hiding its head in the sand at the first sign of danger. The Roman writer Pliny the Elder is noted for his descriptions of the ostrich in his Naturalis Historia, where he describes the ostrich and the fact that it hides its head in a bush. There have been no recorded observations of this behavior. A common counter-argument is that a species that displayed this behavior would not likely survive very long. The myth may have resulted from the fact that, from a distance, when ostriches feed they appear to be burying their head in the sand because they deliberately swallow sand and pebbles to help grind up their food. Burying their heads in sand will in fact suffocate the ostrich. When lying down and hiding from predators, the birds are known to lay their head and neck flat on the ground, making them appear as a mound of earth from a distance. This even works for the males, as they hold wings and tail low, the "flickering" of the hot, dry air that often occurs in their habitat aiding to make them appear as a nondescript dark lump. When threatened, ostriches run away, but they can also seriously injure with kicks from their powerful legs.
The ostrich's behavior is also mentioned in what is thought to be the most ancient book of the Bible in God's discourse to Job (Job 39.13-18)and is described as joyfully proud of its small wings, unmindful of the safety of its nest, a bird that treats her offspring harshly, that lacks in wisdom, and yet can put a horse to shame with its speed."
Animal Facts, Animal Fables-- McGraw Hill Reading Textbooks