We have determined the nucleotide sequence of three positive single-stranded RNA coliphages and have used this information, together with the known sequences of the related phages Q beta and SP, to construct a secondary structure model for the two distal domains of Q beta RNA. The 3' terminal domain, which is about 100 nucleotides long, contains most of the 3' untranslated region and folds into four short, regular hairpins. The adjacent 3' replicase domain contains about 1100 nucleotides. Hairpins in this protein-coding domain are much longer and more irregular than in the 3' untranslated region. Both domains are defined by long-distance interactions. The secondary structure is not a collection of hairpin structures connected by single-stranded regions. Rather, the RNA stretches between the stem-loop structures are all involved in an extensive array of long-distance interactions that contract the molecule to a rigid structure in which all hairpins are predicted to have a fixed position with respect to each other. A general feature of the model is that helices tend to be organized in four-way junctions with little or no unpaired nucleotides between them. As a result, there is a potential for coaxial stacking of adjacent stems. The essential features of the model are supported by the S1 nuclease cleavage pattern. Viral RNA sequences are strongly constrained by their coding function. As a result, structural evolution by simple base-pair substitution is not always possible, as this usually requires the juxtaposition of the codon wobble positions in stems. Rather, we often observe co-ordinate base substitutions that maintain the stem, but tend to change the position at which bulges or internal loops are found. Structures that differ in this way are apparently equally fit. Also, the relative position of hairpin loops can shift several nucleotides through an alignment based on maximal sequence identity i.e. amino acid homology. The fact that these structural irregularities do not occur at the 3' untranslated region suggests indeed that the coding function of the RNA constrains the secondary structure. Hairpins with the stable tetraloop motif GNRA and UNCG or their complement are over-represented. This suggests their involvement in segregation of plus and minus strand. The genome of the coliphages contains a well-defined high affinity binding site for the coat protein, which serves to suppress replicase translation and also acts as a nucleation point in capsid formation. Close to the 3' end we find an additional conserved helix that meets the described consensus criteria for coat-protein binding.