Origin of Photosynthesis
Structural comparison of chlorophyll-containing proteins led to a suggestion that their common ancestor was a large membrane-embedded protein with more than 10 membrane spans, supposedly protecting the primeval cells from the hazards of the UV light. It is conceivable that a purely dissipative photochemistry started still in the context of the UV-protection. The mutations causing the loss of certain porphyrin-type pigments may have led to the acquisition of redox cofactors and paved the way for a gradual transition from dissipative to productive photochemistry [16, 17]
The first phototrophic bacteria
The analysis of 15 complete cyanobacterial genome sequences revealed 1,054 protein families [core cyanobacterial clusters of orthologous groups of proteins (core CyOGs)] encoded in at least 14 of them. The majority of the core CyOGs are involved in central cellular functions that are shared with other bacteria; 50 core CyOGs are specific for cyanobacteria, whereas 84 are exclusively shared by cyanobacteria and plants and/or other plastid-carrying eukaryotes, such as diatoms or apicomplexans. The latter group includes 35 families of uncharacterized proteins, which could also be involved in photosynthesis. Only a few components of cyanobacterial photosynthetic machinery were found in the genomes of the anoxygenic phototrophic bacteria Chlorobium tepidum, Rhodopseudomonas palustris, Chloroflexus aurantiacus, or Heliobacillus mobilis. These observations, coupled with recent geological data on the properties of the ancient phototrophs, suggest that photosynthesis originated in the cyanobacterial lineage under the selective pressures of UV light and depletion of electron donors. We propose that the first phototrophs were anaerobic ancestors of cyanobacteria ("procyanobacteria") that conducted anoxygenic photosynthesis using a photosystem I-like reaction center, somewhat similar to the heterocysts of modern filamentous cyanobacteria. From procyanobacteria, photosynthesis spread to other phyla by way of lateral gene transfer.
Distribution of photosynthetic genes in different lineages of phototrophs and the directions of proposed lateral gene transfer. The phototrophic phyla are depicted in accordance with the depth of their location in modern (and perhaps primordial) microbial mats. Rounded boxes show the extent of photosynthetic gene transfer between the phyla, with the numbers of genes (CyOGs) transferred indicated in parentheses. Dashed boxes show major photosynthesis-relevant ‘‘inventions’’ that occurred outside the (pro-) cyanobacterial lineage. The figure is taken taken from 
Origin of the ATP Synthase
The F-type ATP synthases show homology to another family of rotating machines, namely the V-type ATPases which are found in archaea and in eukaryotic membranes. By analyzing the homology pattern for different subunits of these related enzymes, we have put forward a scenario of their origin from primordial protein translocases.
Proposed evolution of the F- and V-type membrane ATPases.The figure is taken taken from 
Origin and Evolution of Membrane Bioenergetics
Both F-type and V-type ATPases can translocate either protons or sodium ions. We combine structural and phylogenetic analyses to clarify the evolutionary relation between the proton- and sodium-translocating ATPases. A comparison of the structures of the membrane-embedded oligomeric proteolipid rings of sodium-dependent F- and V-ATPases reveals nearly identical sets of amino acids involved in sodium binding. We show that the sodium-dependent ATPases are scattered among proton-dependent ATPases in both the F- and the V-branches of the phylogenetic tree. Barring convergent emergence of the same set of ligands in several lineages, these findings indicate that the use of sodium gradient for ATP synthesis is the ancestral modality of membrane bioenergetics. Thus, a primitive, sodium-impermeable but proton-permeable cell membrane that harboured a set of sodium-transporting enzymes appears to have been the evolutionary predecessor of the more structurally demanding proton-tight membranes. The use of proton as the coupling ion appears to be a later innovation that emerged on several independent occasions[4, 5, 7].
The proposed scenario for the evolution of membrane bioenergetics. The scheme shows the proposed transition from primitive membranes that were leaky both to Na+ and H+ (dotted lines), via membranes that were Na+-tight but H+-leaky (dashed lines) to the membranes that were impermeable to H+ and Na+ (solid lines). Dashed arrows show symbiotic acquisitions of a-proteobacteria (purple arrow) and of cyanobacteria (green arrow). The scheme emphasises that proton tightness of the membranes was achieved in different ways in different lineages. The figure is taken taken from 
N-ATPases - a new family of rotary ATPasesAn analysis of the distribution of the sodium-translocating ATPases/ATP synthases among microbial genomes identified an atypical form of the F1FO-type ATPase that is encoded in a number of phylogenetically diverse marine, halotolerant and pathogenic bacteria and in the archaea Methanosarcina barkeri and M. acetivorans,. In complete genomes, representatives of this form (referred to here as an N-ATPase) are always present as second copies, in addition to the typical proton-translocating ATP synthases. The N-ATPase is encoded by a highly conserved operon and its subunits cluster separately from the equivalent subunits of the typical F-type ATPases. The c subunits of N-ATPases usually carry a full set of sodium-binding residues, indicating that most of these enzymes are sodium-translocating ATPases that likely confer on their hosts the ability to extrude sodium ions. We suggest that N-ATPases are an early-diverging branch of membrane ion-translocating ATPases that, similarly to the eukaryotic V-type ATPases, are not involved in the synthesis of ATP. The identification of this early branching family of Na+-translocating ATPases supports the suggestion that the common ancestor of the rotary ATPases was a sodium-binding enzyme. Thus, the Na-translocating common ancestor of all F-type ATPases apparently gave rise to two different families of ATPases: (i) the reversibleATPases/ATP synthases (‘genuine’F-ATPases) and (ii) ATP-driven ion pumps (N-ATPases).
2. Dibrova, D.V., M.Y.Galperin, A.Y. Mulkidjanian, 2010. Characterization of the N-ATPase, a distinct, laterally transferred Na+-translocating form of the bacterial F-type membrane ATPase (Discovery Note). Bioinformatics, 26:1473-1476 (freely accessible at http://bioinformatics.oxfordjournals.org/cgi/content/full/26/12/1473?view=longpmid=20472544)
6. Mulkidjanian, A.Y., E. V. Koonin, K. S. Makarova, R. Haselkorn, M. Y. Galperin 2008. Origin and evolution of photosynthesis: Clues from genome comparison, In Photosynthesis. Energy from the Sun. J.F. Allen, E.Gantt, J.H.Golbech and B.Osmond, editors, Springer, New York, 1175-1181. (Full text, pdf)
8. Mulkidjanian, A.Y., K.S. Makarova, M.Y. Galperin and E.V. Koonin. 2007. Inventing the dynamo machine: On the origin of the F-type and V-type membrane ATPases from membrane RNA/protein translocases, Nature Reviews Microbiology, 5:892-899.(Full text, pdf)
9. Mulkidjanian, A.Y. and M. Y. Galperin. 2007. Physico-chemical and evolutionary constraints for the formation and selection of first biopolymers: Towards the consensus paradigm of the abiogenic origin of life. Chemistry and Biodiversity, 4:2003-2015.(Full text, pdf)
10. Mulkidjanian, A.Y., E. V. Koonin, K. S. Makarova, S. L. Mekhedov, A. Sorokin, Y. I. Wolf, A. Dufresne, F. Partensky, H. Burd, D. Kaznadzey, R. Haselkorn, M. Y. Galperin 2006. The cyanobacterial genome core and the origin of photosynthesis, Proc. Natl. Acad. Sci. U.S.A., 103: 13126-13131. (Full text, pdf)
13. Galperin, MY, Gaidenko, TA, Mulkidjanian, AY, Nakano, M, Price, CW. 2001. MHYT, a new integral membrane sensor domain. FEMS Microbiol Lett, 205, 17-23.
14. Mulkidjanian, A.Y. and W. Junge. 1999. Primordial UV-protectors as ancestors of the photosynthetic pigment-proteins. In The Phototrophic Prokaryotes. G.A. Peschek, W. Löffelhardt, and G. Schmetterer, editors. Kluwer/Academic/Plenum Publishers, New York. 805-812.
15. Mulkidjanian, A.Y. and W. Junge. 1997. On the origin of photosynthesis as inferred from sequence analysis: A primordial UV-protector as common ancestor of reaction centers and antenna proteins. Photosyn. Res., 51, 27-42(Full text, pdf)