Start with the right socks -- a moisture-wicking synthetic liner inside a wool-mix sock is a popular choice [source: Pacific Crest Trail Association]. Then try to keep your feet clean and dry -- fabric "gators" that wrap around your boot and leg close the gap at the top of your boot, not only keeping out moisture but also keeping grime from sneaking in.
If your feet sweat, take your boots and socks off during rest breaks. If possible cool your feet off in a stream and then elevate them. Consider carrying a few extra pairs of socks and changing into them at these rest breaks. Wet skin increases friction and friction causes blisters.
Rinse out your nasty, sweaty, grimy socks in a stream and hang them on the outside of your pack. Not only will this trick ensure you have another clean, dry pair of socks to change into, but perhaps it will keep your hiking partners from crowding behind you on the trail.