The primary molecular mechanism behind an oscillating gene is best described as a transcription/translation feedback loop. This loop contains both positive regulators, which increase gene expression, and negative regulators, which decrease gene expression. The fundamental elements of these loops are found across different phyla. In the mammalian circadian clock, for example, transcription factors CLOCK and BMAL1 are the positive regulators. CLOCK and BMAL1 bind to the E-box of oscillating genes, such as Per1, Per2, and Per3 and Cry1 and Cry2, and upregulate their transcription. When the PERs and CRYs form a heterocomplex in the cytoplasm and enter the nucleus again, they inhibit their own transcription.  This means that over time the mRNA and protein levels of PERs and CRYs, or any other oscillating gene under this mechanism, will oscillate.
There also exists a secondary feedback loop, or stabilizing loop, which regulates the cyclic expression of Bmal1. This is caused by two nuclear receptors, REV-ERB and ROR,  which suppresses and activates Bmal1 transcription, respectively.
In addition to these feedback loops, post-translational modifications also play a role in changing the characteristics of the circadian clock, such as its period. Without any type of feedback repression, the molecular clock would have a period of just a few hours. Casein kinase members CK1ε and CK1δ were both found to be mammalian protein kinases involved in circadian regulation. Mutations in these kinases are associated with familial advanced sleep phase syndrome (FASPS). In general, phosphorylation is necessary for the degradation of PERs via ubiquitin ligases. In contrast, phosphorylation of BMAL1 via CK2 is important for accumulation of BMAL1.