In this note we deduce well-known modular identities for Jacobi theta functions using the spectral representations associated with the real valued Brownian motion taking values on $[-1,+1]$. We consider two cases: (i) reflection at $-1$ and $+1$, (ii) killing at $-1$ and $+1$. It is seen that these two representations give, in a sense, most compact forms of the modular theta-function identities. We study also discrete Gaussian distributions generated by theta functions, and derive, in particular, addition formulas for discrete Gaussian variables.