A large percentage of scientific journal articles have multiple authors. The commonly accepted guideline for authorship is that one must have substantially contributed to the development of the paper. A substantial contribution includes, but is not limited to, satisfying one or more of the criteria discussed below.
Did the particular scientist initiate or develop the central ideas discussed in the journal article? The development of ideas encompasses a wide scope of tasks. Included are contributions that determine whether an individual or group designed the research plan and/or developed the funding for the research program. The latter is not a small contribution. Many good ideas are not investigated because there is no funding to examine the proposed hypotheses.
Potential authorship roles include individuals or groups who actually gather the data needed by the program in progress. The data may or may not have been in the initial study design. Some papers include data that are relevant to the problem being investigated, but were gathered for other purposes. Often, the main person responsible for gathering the external data set is included as an author, especially if that scientist has not published an article using the data.
There is a subtle problem associated with these criteria, however, as larger projects often have one or more research scientists that design how data is to be collected and may have a technician or set of technicians who configure the instruments or carry out the specified analyses. If the technical staff contributes to an analysis, refines or improves the analysis, and also discusses with the research staff how the results of the analysis affects the hypothesis under study, they are usually included in the authorship list. Additional articles may be written that address new developments in analytical or instrumental procedures. A technician is usually the first author on these articles.
Finally, who actually writes the paper is significant. An individual who has written substantial sections of a paper that describe: 1) why the research problem is important, 2) how it fits into the general knowledge available on the subject, and 3) how the new paradigms advance the state-of-the-art knowledge in that field, is usually considered the first author.
Several of the above criteria apply to the sample case study. In general, the graduate student who is responsible for designing and carrying out the research, and who writes substantial sections of the journal article, is first author. The adviser may have initiated and developed the funding for the larger project (here I am assuming that there is more than one research task that is addressed by the larger project) and helped the graduate student with guidelines for the analyses and interpretation of that research. This adviser is usually an author, but not the primary author. The adviser gets a fair amount of credit for the paper anyhow, as most people understand that an adviser contributes substantially to a graduate student's research project. Other scientists who meet the above criteria are included as an author in ratio of their contribution, providing their contribution is substantial.
The position of first authorship is not commonly given to someone just because he/she is the most senior scientist or most senior graduate student in a lab or research program. One exception--the senior scientist tends to be the first author on a general article that describes extended results of a large research program (i.e., an introduction to a special issue of a journal that includes many specific articles from that research program). However, there are no hard standards for the order of authorship. Most institutions have guidelines, but few are written down. Even the practices stated above are compilations and interpretations of general, unstated policies followed by the several research institutions with which I collaborate. Many scientists follow rules similar to the ones described above. The main enforcement for authorship policy is scientific stature and reputation. The scientific communities in any particular discipline usually know if a scientist violates generally accepted practices.
The journals I have been an editor for ( Eos, Transactions of the American Geophysical Union, and Estuaries) have no guidelines for the order of authors. Journals, even those I just submit papers to, accept the order of the authors as given. The editor assumes that the group who submitted the article is satisfied with the author order. They only require an implicit assurance from the senior author that all listed authors contributed to the manuscript.
Marlene Noble, a physical oceanographer with the U.S. Geological Survey  in Menlo Park, California, serves as associate editor of Estuaries.