Modify (strech) one object by moving another object
You could use hooks: select B and then A, then go to edit mode (of A).
select the A face near to B and add a hook to selected object (CTRL-H).

Now, when you move B, A will be stretched, since you're thus moving the hooked face of A, through B.

Eg: