A ram is a male goat. Goats were one of the animals that people could sacrifice to God.
Just at the right moment, God caused the ram to be stuck in the bush.