Whatever was holding up a third HIV drug partnership between Gilead Sciences (Nasdaq: GILD) and Johnson & Johnson (NYSE: JNJ) seems to have been worked out.

Gilead and J&J set up a pact in June to develop a pill that combines Gilead's development-stage cobicistat and Johnson & Johnson's Prezista; that arrangement followed their first deal for the combo product Complera that's now on the market. The cobicistat-Prezista deal was predicated on the drugmakers' signing an agreement to develop a combo product containing Prezista and cobicistat along with Gilead's Emtriva and another development-stage drug, GS 7340.

Under the terms of the third deal, Gilead will be responsible for the worldwide development and commercialization of the four-drug pill, while J&J retains the right to market the drug alongside Gilead in certain undisclosed major markets.

The terms of the contract weren't disclosed, so it's hard to tell who got the better end of the deal. Since they're partners on multiple products, one would have to guess that neither company was trying to stick it to the other one. Gilead's terms for the Complera deal are better than it has with Bristol-Myers Squibb (NYSE: BMY) for their combo product Atripla, so I'd expect the terms for the four-drug combo to be at least that good.

Whatever the terms of the deal, both companies really need each other to move forward. GlaxoSmithKline (NYSE: GSK) and Pfizer (NYSE: PFE) have teamed up in a joint venture called ViiV Healthcare. The only way for other HIV drugmakers to compete with the multiple combo products that ViiV could develop given the plethora of drugs each donated to the joint venture.

Unless J&J is going to buy Gilead -- and while not a bad idea, I wouldn't count on it given J&J's propensity to buy companies smaller than Gilead -- a solid friendship with multiple pacts seems like a good move.

Follow all the HIV drugmakers as they hook up and develop combo products by adding them to My Watchlist, the Fool's free watchlist service. You can add all the companies or use the following links for individual companies:

Fool contributor Brian Orelli holds no position in any company mentioned. Check out his holdings and a short bio. The Motley Fool owns shares of Johnson & Johnson. Motley Fool newsletter services have recommended buying shares of Gilead Sciences, Johnson & Johnson, Pfizer, and GlaxoSmithKline and creating a diagonal call position in Johnson & Johnson. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.