compare two same armature structure, rotate first armature's bone to the second position
The following python code copies the bone configuration from the active object to all selected armatures. You do not need to bother with rotation matrix here because the bones are defined in local space, thus the global rotation of the armatures does not need to be taken into account:

import bpy

# Assume, that context.object is an armature
context = bpy.context
scene   = context.scene
source  = context.object

# Targets are all other selected armatures
targets = [a for a in context.selected_objects if a != source and a.type=='ARMATURE']

# Store the bone data of source:
bpy.ops.object.mode_set(mode='EDIT')
bone_store = []
for ebone in source.data.edit_bones:
    bone_store.append([ebone.name, ebone.head.copy(), ebone.tail.copy(), ebone.roll])
bpy.ops.object.mode_set(mode='OBJECT')


for target in targets:
    scene.objects.active = target
    bpy.ops.object.mode_set(mode='EDIT')

    # Transfer the bones to the other armature.
    # The following works because the bone data is defined in local space:

    ebones = target.data.edit_bones
    for bone_data in bone_store:
        bid =  bone_data[0]
        if bid in ebones:
            ebone      = ebones[bid]
            ebone.head = bone_data[1].copy()
            ebone.tail = bone_data[2].copy()
            ebone.roll = bone_data[3]

    # Note: You might also want to copy constraints

    bpy.ops.object.mode_set(mode='OBJECT')

scene.objects.active = source


And here is a snippet that copies only the pose from one armature to the other:

import bpy

# Assume, that context.object is an armature
context = bpy.context
scene   = context.scene
source  = context.object

# Targets are all other selected armatures
targets = [a for a in context.selected_objects if a != source and a.type=='ARMATURE']

bpy.ops.object.mode_set(mode='POSE')
bpy.ops.pose.select_all(action="SELECT")
bpy.ops.pose.copy()

for target in targets:
    scene.objects.active = target
    bpy.ops.object.mode_set(mode='POSE')
    bpy.ops.pose.paste()