The eggs are microscopic and can float in the air like dust particles. They land on food and plates and are then ingested by someone else to keep the cycle going. It is for this reason that family members are very likely to catch the infection. Pinworm eggs are the only worms infecting humans that are mature as soon as they are laid and capable of infecting someone new right away. All the other round worms, like hookworms, require a maturation phase outside the body, usually in soil, and are therefore more common in poor communities where kids run around barefoot.
Treatment can be with either mebendazole or pyrantel pamoate, both given as a single dose.
The dose may be repeated after two weeks to catch the worms that hatched after the first treatment. Both drugs are quite safe and require no special preparation, such as fasting. I wouldn't treat family members unless they have symptoms. The only way to prevent transmission is rigorous hand washing and careful cleaning of all plates and utensils. Since the infection isn't dangerous, I wouldn't make too much of it.