In this paper, we propose a new frequency-switching array (FSA) enhanced physical-layer security (PLS) system in terahertz bands, where the carrier frequency can be flexibly switched and small frequency offsets can be imposed on each antenna at Alice, so as to eliminate information wiretapping by undesired eavesdroppers. First, we analytically show that by flexibly controlling the carrier frequency parameters, FSAs can effectively form uniform/non-uniform sparse arrays, hence resembling movable antennas (MAs) in the control of inter-antenna spacing and providing additional degree-of-freedom (DoF) in the beam control. Although the proposed FSA experiences additional path-gain attenuation in the received signals, it can overcome several hardware and signal processing issues incurred by MAs, such as limited positioning accuracy, considerable response latency, and demanding hardware and energy cost. To shed useful insights, we first consider a secrecy-guaranteed problem with a null-steering constraint for which maximum ratio transmission (MRT) beamformer is considered at Alice and the frequency offsets are set as uniform frequency increment. Interestingly, it is shown that the proposed FSA can flexibly realize null-steering over Eve in both the angular domain (by tuning carrier frequency) and range domain (by controlling per-antenna frequency offset), thereby achieving improved PLS performance. Then, for the general case, we propose an efficient algorithm to solve the formulated non-convex problem by using the block coordinate descent (BCD) and projected gradient ascent (PGA) techniques. Finally, numerical results demonstrate the convergence of the proposed optimization algorithm and its superiority over fixed-position arrays (FPAs) in terms of secrecy-rate performance.