A team that is losing by one or two goals in the last few minutes of play will often elect to " pull the goalie " ; that is , remove the goaltender and replace him or her with an " extra attacker " on the ice in the hope of gaining enough advantage to score a goal .