From Ryanair's website (which reproduces the same information that many other travel operators quote):
"Portuguese routes: Portuguese nationals and alien residents under 18 years leaving or re-entering Portugal unaccompanied by their father, mother or legal guardian need a travel authorisation. This must be signed by the father, mother or legal guardian with the signature notarised if the father, mother or legal guardian reside in Portugal; or authenticated by a Portuguese embassy or consulate in the country where the father, mother or legal guardian reside.
This travel authorisation is also required when minors are accompanied by a person other than their father, mother or legal guardian. In such cases the travel authorisation must also clearly show the name of the accompanying person. Foreign minors under 18 years and traveling alone may be refused entry if they do not have anyone in Portugal taking responsibility for their stay".
Chris