I've always thought the order of the players entering the pitch was random after the Captain, who is always first, but for some reason this weekend I noticed that the goalkeeper was right behind the Captain in all of the matches I watched, in both the English Premiere and French leagues. Is there a rule dictating the order of players entering the pitch?
Both Ronan's and user2184's answers are about right. The captain exits first because so that they can shake the ref's and other captains hand before the rest of the team. This because they are supposed to lead by example and,although it is not seen in the modern game as much as it still is in rugby, be the most senior player on the pitch.
Tradition dictates the formation behind him should go in ascending order of number, but some of the more famous players do come out last. For some self obsessed players, such as Ronaldo, it may be for the bigger cheer, but usually it is because they do not want the rest of the team to not get their deserved appreciation because the fans are focused on them.
Hope that helps.
Generally teams enter the field captain first followed by the players in ascending order of the numbers on their back. Seeing as the goalkeepers usually wear number 1 they will follow the captain (followed by no. 2,3,4,5,6... etc)
There is no rule about the order in which players enter the pitch that I could see. However I would guess that there is a rule or just a tradition for the captain to enter onto the pitch first. Usually the goalkeeper is second but after that it seems not to matter what order they enter onto the field. Players like Ronaldo usually seem to go out last (maybe to get the biggest cheer from the crowd?). For the team there is definitely no rule for the order in which they must enter onto the pitch.