Most but not all Russian Su-27's (and variants like the Su-30, -32, -33) have a device that looks like a headlight in front of the cockpit. What is it?
It's the sensor of the IRST (InfraRed Search and Track) system. An IRST allow an aircraft to search and track aerial or ground targets using passive infra-red radiation only thus reducing the probability of being discovered (for example using a Radar Warning Receiver).
The Su-27 can use it's IRST to track a target at very long distance and engage it using IR homing AAMs like the R-73 "Archer" or the R-27T / R-27ET "Alamo" without using its radar.
Nowadays, many current fighter aircrafts use some sort of IRST, for example the Eurofighter Typhoon.
That is the IRST which can be used for tracking aircraft passively.