A periodic array of InSb spheres on a substrate is numerically analyzed at terahertz frequencies. The incident field is shown to be coupled to the substrate due to the guided-mode resonance. The effect of the background refractive index on the transmission characteristics is investigated for sensor applications.