Imo this is not a simple problem with wings current toolset.
Whilst a modified approach similar to that outlined by JDex will cope with the relatively straightforward scenario shown in prob4.jpg the same approach cannot really be used for non-trivial examples when the 2 end faces arent parallel.
<< to know the angle of b and then just rotate a to same angle >>
No this wont work, because if you rotate a (and keep its length constant), the top (anchor) face will become distorted. Using Flatten on this face to regain flatness will introduce another (different) error, since the Flatten vector angle is different from that of the bridge piece.
It is also possible to use the scale radial -> 0% technique here, by defining the axis vector from one of the (correct) edges and anchoring its origin on one of the verts associated with the edge to be adjusted BUT the end where movement / adjustment takes place will need adjustment in the same way as rotating it.
<< this would be easier if you had a function that you selected one face , select anouther and bamm the second face is the same shape and size as the first , then bridge perfectly >>
If the faces arent on parallel planes, then no this also wont work.
In this case the constancy of the true cross-sectional shape of the bridging beam will be compromised. Having the same shape on angled end objects will only guarantee a beam of constant cross-section under very particular circumstances.
Any adjustment to the faces at the ends of the bridging beam MUST be made along vectors defined from the edges of beam (assuming its already correct and parallel) otherwise you will introduce errors.
Applying vector moves on the individual verts at the ends of the beam one at a time, using a beam edge for vector definition will accomplish this but, unfortunately, its an eyeball job 
(Switch into w/frame mode, Ortho, tumble model until a beam end face becomes a single straight edge (side view) then (vector) move end face verts until they lie on this line.)
Theres various approaches to all of this (although no magic bullet imo) - but it depends a lot on exactly what you want to do and the precise nature of the geometry you start with and that which you wish to create 
pp
<< i notice you can align to xyz , align to any other face would be a good option , boy that would be usefull , that solves the problem above also , a one click solution : ) >>
Highly unlikely - even if it did exist 