From the Science instructions to authors:
By submitting a manuscript, the corresponding author accepts the responsibility that all authors have agreed to be so listed and have seen and approved the manuscript, its content, and its submission to Science. Any changes in authorship must be approved in writing by all the original authors.
You don't co-author a paper whose conclusions you disagree with. That's fraud. If you use someone's computer program, you cite the program in the reference section, and maybe thank the author if it's not generally available.
My own professional society, ACS, has published a quite detailed statement of ethical principles, at: http://pubs.acs.org/instruct/ethic2000.pdf
Quoting The co-authors of a paper should be all those persons who have made significant scientific contributions to the work reported and who share responsibility and accountability for the results. Other contributions should be indicated in a footnote or an Acknowledgments section.