The squeezing of leg muscles pumps blood back to the heart from the lower body. Veins have valves that act as one-way flaps. These valves prevent the blood from flowing backwards as it moves up the legs. If the one-way valves become weak, blood can leak back into the vein and collect there. This problem is called venous insufficiency. Pooled blood enlarges the vein and it becomes varicose. Spider veins can also be caused by the backup of blood. Hormone changes, inherited factors, and exposure to the sun can also cause spider veins.
This answer is based on source information from The National Women's Health Information Center.