Rapid physiological processes are triggered by electrical signals initiated by sodium channels. We determined structures of the bacterial ancestor NavAb in resting and activated states. Our structures support the sliding-helix mechanism of voltage-dependent activation, in which gating charges in the S6 transmembrane helix move across the membrane through the protein structure, exchange ion pair partners, and initiate conformation changes to open the pore. Pore-opening is mediated by subtle rotation and bending of the pore-lining S6 helices to open the activation gate at their intracellular ends. Slow inactivation involves partial collapse of the pore, in which two S6 segments move toward the central axis and two move away. Ion conductance is mediated by a selectivity filter that is short, ~4.6 Å wide, and water-filled, with negative charges at its entry. Sodium is conducted as a hydrated cation and interacts sequentially with three sites in the selectivity filter. The human Nav1.7 channel is a prime toxin target for novel analgesics. We developed chimeras in which the S1-S2 and S3-S4 linkers in Domain II of Nav1.7 are grafted onto NavAb to form a fully functional chimera. These structures determined with the tarantula toxin, Huwentoxin-IV, specifically bound to the resting state reveal a unique high-affinity complex with a '"stinger" lysine penetrating the voltage sensor. Mammalian cardiac Nav1.5 channels have a highly conserved transmembrane core with a chemically unique DEKA motif at the point of sodium entry into the selectivity filter. The fast inactivation gate folds into the pore according to a hinged-lid mechanism and prevents pore opening through local allosteric interactions. The scorpion toxin LqhIII binds with high affinity to the extracellular region of the voltage sensor in Domain IV and prevents fast inactivation. Our results reveal fundamental mechanisms of sodium channel function and provide unique insights into neurotoxin binding at the atomic level.