What was a rood screen used for in a church?

In Catholic churches and possibly others, the communion rail is what is left of the rood screen. It was a separation between the congregation and the altar area of a church.