Sugars are required for present energy production but also as a part of the backbone (ribose, deoxyribose) of present genetic material. Many sugars can be synthesized in prebiotic conditions, using carbon based molecules with oxygen, such as glycoaldehyde and formaldehyde (both found in interstellar gases), as shown in the figure below. Glycoaldehyde was recently found in star forming regions of the Milky Way where planets are likely to form. The presence of borate, which stabilizes vicinal OHs on sugars, is required for the production of sugars instead of tars.
RNA molecules containing sugars such as threose, aldopentopyraonses and hexopyranose can also form stable secondary structures like helices. (Remember, RNA probably preceded DNA as the genetic carrier of information given that is also has enzymatic activity). Is there something special about ribose that made it selected over other sugars for nucleic acids, especially since it is found in low abundancy in the products in synthesis reactions conducted under prebiotic conditions? One probable reason is it unusually high (compared to other sugars) permeability coefficient through vesicles made of phospholipids or single chain fatty acids, as shown below.
In general, the greater the number of carbon atoms, the smaller the permeability. However, the table above clearly shows large differences in permeability for sugar isomers with the same number of C atoms, and the difference is not affected by the lipid composition. Ribose has markedly elevated permeability compared to other 5C sugars (as do erythritol and threitol among 4 C sugar alcohols). What is so unique about ribose? 20% of the sugar is in the furanose form. Rate constants for ring opening of furanoses are elevated, suggesting greater flexibility. The α-furanose anomer is amphiphilic in that one face is hydrophobic and the other hydrophilic. All of these may promote ribose permeability.
Jmol: a-D-ribofuranose alpha-D-ribopyranose at http://www.chemeddl.org/resources/models360/models.php