How many authors are there total? Where is the PI listed as an author?
PIs are almost always listed last as previously stated. If there is more than one PI, the main PI is listed last and the others second to last, third to last, etc., in reverse order of who contributed most. In rare cases somethimes PIs are listed first.
As has been previously stated, first author should be the person who contributed most to the paper. Having at least one first author paper, while not absolutely necessary to get a PhD, is pretty important because it shows you did a significant and original body of work. Being first author has a lot of meaning.
Second author means less. You know the second author did less work than the first author, but how much less? If there are a whole bunch of authors, maybe first author did 80% of the work and everyone else did 1-2%. If there are 3-5 authors, second author has a bit more meaning.
Third, fourth, fifth, etc.: I think the distinction for any authors further down than second is pretty meaningless. You did enough work to be listed as an author, but were not a major contributor (that is first and in some cases 2nd author). If you know what the paper is about and can talk about it intelligently, that is more important than where exactly you are listed. I don't know where you are listed, but if your friend was further than 2nd, I wouldn't worry about it--be happy you were listed as an author! You could have gotten an acknowledgement.