Most of the time, a character is mounted on the same size of base as the unit they decides to join. In this case, the character can simply be added to the front rank, displacing another model as described above. Naturally, this gets a little more involved if the character has a different-sized base to the members of the unit. Here we have to use a little common sense to make everything work.
If a character's base is larger than one model, but has exactly the same size area (or 'footprint') as two or more models, simply displace those models to the back rank and position the character in their place.
If your character(s) fit into the unit in this manner, work out the unit's ranks (and therefore its rank bonus) as if the space was filled with rank and file troops.
If a character's footprint does not fit neatly into a unit, place them on the edge of the unit, beside the front rank, facing the same direction as the rest of the unit. In this case we do not assume the character's footprint to be filled by rank-and-file troops.