I'm not sure I'm likely to add anything to the sum of all knowledge here, but I'll lay out my theories based on experiences over the past few years. There's several approaches I've adopted, with varying degrees of success. Most critically, both (or possibly all, I suppose) parties should agree in advance on three things:
1) What craft approach will be used -- the bulk of the discussion following
2) How the editorial process will occur -- for example, who gets to change existing prose when
3) How marketing will occur and how the byline and payment will be split
Back to front...
Marketing, Byline and Payment
One and only one person should handle marketing the finished work. This avoids accidental double submission or simultaneous submission -- double subs make you look stupid, simultaneous subs make you look unprofessional. On the byline, agree right up front what order the names should be presented in. This can be far more contentious than you might think, and is a discussion where a high degree of objectivity will serve you well. Don't solve this problem after the fact. As for payment, determine what split is appropriate. I have yet to do a collab where a 50/50 split wasn't desired, but I could imagine circumstances where that might be the case.
This is another potentially contentious issue. Can either collaborative partner change the other's prose? Who gets the final edit? Can changes be rolled back unilaterally? To some degree, editorial process is dependent on the craft approach. There's not a right or wrong answer here, but there does need to be clarity, or disagreements will flare.
I have tried several approaches with mixed degrees of success. Which one to adopt depends very much on the personalities and styles of the collaborative partners, as well as the state and form of the idea when it enters collaboration.
Pass the Draft
One partner writes a draft of the entire work. The other rewrites it, typically with as much latitude as they choose to bring to bear (including a blank sheet rewrite if needed.) Editorial process moves back and forth on a full-draft basis until the work is finished. This is how specficrider and I wrote "The Canadian Who Came Almost All the Way Home From the Stars", which we sold to SCI FICTION. This approach is useful when one writer has developed a story on which they have become terminally stuck. It requires perhaps the highest level of trust and sympatico of all these approaches, since, in effect, the original drafter is handing their baby off to someone else to mutilate.
Pass the Scene
One partner writes a scene (or subscene), then sends it to the other partner who writes the next scene (or subscene). This is how specficrider and I wrote "Return to Nowhere", which we sold to Jigsaw Nation. Main issue here is defining whether or not the receiving writer has the right to line editor or rewrite the most recent scene as it lands on their desk. This approach is useful for two writers who roughly similar levels of time and energy to devote to the project. if a story has two (or more) voices, such as multiple POVs or interwoven flashbacks, each writer can take on one thread of the story and work solely within that voice.
Face to Face
Perhaps the least practical method, this one does permit direct, rough-and-tumble collaboration. Two writers work together in the same room at the same time, either switching seats at the keyboard, or discussing the story progress as one types. I've never sold anything this way, but I've produced some interesting work.
I'm sure there are other methods of collaboration. I'd be curious what people think, or other ways they've tried.