A Radar Warning Receiver/ RWR is used for this kind of detection; it basically looks for the presence of energy in a specific radar band (once you've been 'lit') and the fancy ones can analyze the signal strength, phase and waveform type, giving a reasonable estimate of the actual threat.