Freckles are a dominant trait. Freckles come from genes and the sun and are most often seen on people with light-colored skin.
Freckles are a result of exposure to the ultraviolet light that comes from the sun. Melanin is made when the sun's rays hit the skin as a way of shading and protecting it. If a person produces melanin evenly, it's called tanning. Those people who produce it in clumps tend to freckle.
Scientists are not sure as to why some people tan and others freckle. They suspect it's because the gene that causes freckles, called MC1R, doesn't work well in some people. In those people whose MC1R gene fails on two levels, red hair and freckles are prominent traits. It is more common for the gene to fail on the level that causes freckles than it is to fail and produce both red hair and freckles.