An important modulation technique for Internet of Things (IoT) is the one proposed by the LoRa allianceTM. In this paper we analyze the M-ary LoRa modulation in the time and frequency domains. First, we provide the signal description in the time domain, and show that LoRa is a memoryless continuous phase modulation. The cross-correlation between the transmitted waveforms is determined, proving that LoRa can be considered approximately an orthogonal modulation only for large M. Then, we investigate the spectral characteristics of the signal modulated by random data, obtaining a closed-form expression of the spectrum in terms of Fresnel functions. Quite surprisingly, we found that LoRa has both continuous and discrete spectra, with the discrete spectrum containing exactly a fraction 1/M of the total signal power.