We show in the framework of the 1D nonlinear Schrödinger equation that the value of the refraction angle of a fundamental soliton beam passing through an optical lattice can be controlled by adjusting either the shape of an individual waveguide or the relative positions of the waveguides. In the case of the shallow refractive index modulation, we develop a general approach for the calculation of the refraction angle change. The shape of a single waveguide crucially affects the refraction direction due to the appearance of a structural form factor in the expression for the density of emitted waves. For a lattice of scatterers, wave-soliton interference inside the lattice leads to the appearance of an additional geometric form factor. As a result, the soliton refraction is more pronounced for the disordered lattices than for the periodic ones.