1. Average the rateings of the allies and use those results, inflicting dammage in proportion to size.
2. Use the best rating of each side.
3. Treat them as individual armies.
Unfortunately Paradox has a policy or tradition of not releaseing details of "under the hood" game mechanics. Most of the FAQs written have been done so by rigorous testing of the underlying mechanics.
I was not implying that what I said was the way it was done rather why you thought it was not done that way, since that would be the easiest way to do it.
If you are really interested I think the only way is to extensivly test it under controled condition, much the way I cracked the colonization success formula, or the Morale stuff. Although testing the battles may be more difficult due to the random luck factor involved. Perhaps saving the game after each phase of combat and looking at the actual stats in the save game may help.