Are you sure its the ignition relay that is clicking and not the starter motor? Have you checked the battery? If battery has low voltage and not enough juice to start the engine, then the starter motor will make clicking sound, and sometimes turn the engine a little if the voltage is not too low. My Toyota RAV4 developed similar problem, it would sometimes make clicking noise and won't start, other times it would start normally, which meant that battery was good. I got it checked from a workshop and it turned out to be bad starter motor, got it replaced and then the problem disappeared.