Only 2% of human DNA gets translated into proteins. What is the purpose of all the rest? The majority gets transcribed into RNA molecules whose function is only beginning to be understood. RNA is a highly flexible polymer that folds onto itself in patterns that are encoded by the genetic sequence. Tools of statistical mechanics and kinetics are required to decipher these patterns, because they are subject to thermal fluctuations. We will apply these tools to examine two recently discovered classes of RNA molecules, microRNAs and riboswitches, that play roles in gene regulation.