This part is a kind of semiconductor called 4N38.
Function of this product has PHOTO TRANSISTOR (AC LINE/DIGITAL LOGIC ISOLATOR).
Manufacturers : Toshiba Semiconductor
Image and pinout :

Some of the text within the PDF file :
[ ... ]
4N38 PDF Datasheet Download
