Project screencast of a Mac on remote controlled second computer
If you are happy to have content on the Mac projecting the image, you can use remote access via VNC or ARD. This approach has Mac A acting as a gateway to view and control Mac B.
Virtual Network Computing / VNC
You can use VNC to remotely connect to and control another computer. VNC is free and built into OS X.
VNC has the benefit that you can use two different types of computers. VNC is not specific to OS X. You could have a Linux computer could control a Mac, or a Mac control a Windows computer.
Apple Remote Desktop / ARD
Apple sell a product that builds upon VNC called Apple Remote Desktop. ARD allows you to more fully manage and control a Mac computer across a wired or wireless network.