There is a bright green sea slug, the Elysia chlorotica, which can eat algae and become photosynthetic, getting it's energy from solar power. The article says that an expert on the slug from the University of Maine has no discovered that the sea slug gets this ability from genes "stolen" from the algae it eats. It was known before that the slug acquired chloroplasts, which allow plant cells to convert sunlight into energy, from the algae then stored them in the cells that outline its gut. What they didn't know was how, after eating algae for two weeks, it could survive the rest of its life without eating. If the sea slug used only the algal chloroplasts, it would not have all the genes needed to photosynthesize. Then, recently, it was discovered that one of the vital algal genes were found in the sea slug's DNA indicating that the slug probably stole the genes from its food. There is no explanation as of right now, only postulates. One possible explanation is as the algae is being processed, the slug's cells take in the genes along with the chloroplasts. The genes are then incorporated into the Slug's DNA, allowing it to produce the necessary proteins to keep the chloroplasts working. Another possible explanation is that a virus found in the sea slug carries the DNA from the algal cells to the slug's cells.
Another recent discovery involving this gene in the sea slug was the finding of the algal gene in the sea slug's sex cells, allowin the ability to maintain functional chloroplasts coul be passed on to the next generation.
Researchers believe that E. chlorotica acquire many more photosynthesis genes from their food but it is still unknown how these genes are activated inside the sea slugs.