Some excellent advice on writing (primarily for mathematicians) can be found at the blog of Terence Tao; see also this post at the blog of Daniel Lemire for some important (especially for beginners) technicalities, and Six Rules for Rewriting by Michael Nielsen. More writing tips can be found here.
Having right coauthors can greatly improve the quality of your paper; for interesting discussions on scientific collaboration go here, here and here (these three posts deal with collaboration in mathematics but can be of interest for other scientists too) at the Secret Blogging Seminar, here and here at the blog of Michael Nielsen; see also this post at the Backreaction blog, and this article by Richard Reis.
Mathematicians can also make use of the classical text How to write mathematics by Paul R. Halmos. Another potentially very promising tool for mathematicians is Tricki (the wiki of math tricks and techniques) whose aims and scope are discussed at the blogs of the Fields medalists Tim Gowers and Terence Tao, see e.g. here and here.
Update: some advice on dealing with the paper rejection can be found here.
Update 2: A very interesting story on turning potential competitors into collaborators is discussed here, here, here and here. See also these two posts and these two discussions on the caveats of peer review and possible danger of scooping (with focus on the life sciences and physics), and this post on the catch 22 of publishing in the top journals.
Update 3: Google has recently produced a demo for a new online collaboration tool, Google Wave; see the post of Terence Tao for more details and a broader discussion of various collaboration tools at the Secret Blogging Seminar.