How to merge a vertex to an edge?
In case of intersecting meshes Intersect operator could be useful. In this case, Intersect / Knife is the one needed.


Select faces which intersect (or select all faces if convenient).
Press Ctrl + F > Intersect / Knife. Faces were cut, i.e. one from the rightmost cube got 2 new vertices and became an Ngon. However meshes aren't connected yet, because there are 2 pairs of vertices which share the same location.
Remove doubles with W > Remove doubles. Now meshes are connected.




Note: Intersect / Knife tool is accessible starting from version 2.77.