Direct photons are a unique probe that allows studying the different stage of ultrarelativistic heavy-ion collisions. The direct photon yield is sensitive to different production mechanisms, which dominate the expected direct photon spectra at different transverse momenta. Their production is also influenced by modifications of the initial state in heavy nuclei. Such modifications can be studied in d+Au collisions, and their understanding is crucial for interpreting heavy-ion data. PHENIX has measured the spectra of direct photons in different collision systems and at different energies, over a broad range of transverse momentum. Photons were measured with different methods, using different subsystems, to extend the range of transverse momentum and to minimize the size of systematic uncertainties. In p+p collisions, PHENIX has also measured isolated direct photons, as well as the fraction of direct photons from jet fragmentation. In this poster, we will present the latest results on direct photon measurements, in heavy-ion collisions as well as in p+p and d+Au collisions, and compare the results with theoretical models.