Electronitc switch without common contact
The component you are looking for is called an opto-coupler (or opto-isolator).

Essentially it is as you suggest in your question, an LED and a Phototransistor built into a single package. You drive the LED and the phototransistor turns on and off depending on whether the LED is lit or not.

Below is the symbol for an opto-coupler:



Essentially 1 and 2 are the input which could be something like a microcontroller I/O pin (e.g. 1 would go to the pin, 2 to GND). Then 3 and 4 are the output which is completely isolated from the input. Current will flow from the collector to emitter of the phototransistor when the LED is illuminated.