Is it absolutely essential that you must have two Pi 3 boards? If you could put your LED and your sensor together on the same board that would make life a lot easier for you.
However, if you really must have two completely separate boards, then one way of communicating between them would be to use the UART serial port. The PI 3 supports two UART devices, a 'mini' UART, and a 'full' UART. The mini UART is typically not used on earlier Pi models, but the Pi 3 utilizes both UARTs: the full UART is required for the onboard Bluetooth, and the mini UART is used for serial comms. As far as I'm aware, the mini UART does not have parity support and its baud rate is derived from the system clock, rather than being programmable.
A full description of using the UART is way beyond what I can write here, but there's a Python module called pySerial that supports it - see
https://pyserial.readthedocs.io/en/late ... rial.html
for more info.
If your two Pi's are in fairly close proximity you could connect the UARTs directly together (remembering to reverse the Tx and Rx connections) which should work fine. However, if they are some distance apart (say in different parts of a building) it may be better to use some proper 3-wire RS232 networking hardware.
This is, of course, just one solution. As davidcoton suggests, you could also consider WiFi or Ethernet, or just some simple bit banging between GPIO pins (although this is really only suitable if your boards are fairly close together).