The majority of roads are free of toll, but there are also roads with tolls called Peaje in Spain. They use a ticket based system that calculates the distance you drove on the motorway, which you pay when you exit the motorway. In portugal on tool roads you pay km travelled while using them. When you commence your journey on a toll road in Portugal there will be a EASYtoll terminal and a machine equipped to read you car registration number, tolls are issues by reading the number plate for electronic payment later. More info