Write $\cos(a_j t) = (\exp(i a_j t) + \exp(-i a_j t))/2$, and expand the product. We get
$$ 2^{-n} \sum_{x \in \\{-1,1\\}^n} \exp \left( i \sum_{j=1}^n x_j a_j t\right) $$ Now note that $$\dfrac{1}{2\pi} \int_0^{2\pi} \exp(ikt)\; dt = \cases{0 & if $k$ is a nonzero integer\cr 1 & if $k = 0$\cr}$$ Thus, assuming the $a_j$ are all integers, your right side becomes $ 2^{-n}$ times the number of $x \in \\{-1,1\\}^n$ such that $\sum_j x_j a_j = 0$, and this is $\mathbb P(X=0)$.
Well, you don't **quite** need the $a_j$ to all be integers: what you need is $\sum_j x_j a_j$ to always be an integer. You could have an even number of half-odd-integers and the rest integers.