We developed a method to detect and analyze conserved gene pairs - pairs of genes that are located close on the same DNA strand in two or more bacterial genomes. For each conserved gene pair, we calculate an estimate of probability that the genes belong to the same operon. The algorithm takes into account several alternative possibilities. One is that functionally unrelated genes may have the same order due simply because they were adjacent in a common ancestor. Other possibilities are that genes may be adjacent in two genomes by chance alone, or due to horizontal transfer of the gene pair.