As the other educators have noted, the purpose of putting coins over the eyes of the dead was to pay passage across the Styx River. The very first reference to this practice comes from the work of Aristophanes, who was a writer of Greek comedies. In his play, The Frogs, he talks about putting a coin in the mouth of a dead person to pay the boatman. It is worth noting that placing a coin inside the mouth of a dead person seems to have been more common than placing it over the eyes.
If you look at the reference link provided, you will see an example of a coin used for this purpose. Note that the coin was small and was of low value, suggesting that the passage across the river was not expensive. This is worth noting because it means that less wealthy families were able to pay the fare for their loved ones and not leave them wandering around in the afterlife.