What does it look like? Is it an IC, a transformer, capacitor, motor, or the label on an equipment enclosure? Help us help you by providing as much additional info as possible.
What you describe could be a few things, an opto would be a good guess though.
Try metering the forward v drop accross pins 1 and 2 with a diode check on a multimeter, if its around 1.8v then that would also support the opto guess, if you have 2 meters then you could check the resistance of the phototransistor at the same time, see if it changes.
Do you want to replace this device?, there may be another you could substitute.