How Could DNA Have Evolved?
While there is no direct fossil evidence for the evolution of DNA (because of its size and fragility), scientists have theorized on its origins based on verified laboratory evidence. One theory goes like this: RNA, the compliment molecule to DNA, was the first to evolve naturally from materials already common in the pre-biotic Earth. Self-replication was achieved through catalytic actions in RNA-based molecules, called ribosomes, or possibly through an intermediary molecule. This step still remains unverified to science as of this writing.
Once self-replication had been achieved, the forces of Natural Selection took over. For example, those molecules which were protected from the elements survived longer and reproduced more. So, any molecules which found themselves with a lipid bubble (which also forms naturally) would have a better chance of reproducing. After many incremental steps, the lipid bubbles eventually became cell membranes, and the molecules DNA.
For more information on the probability of life forming this way, please see this article.