This work is based on ideas of Ilic on the energy of unitary Cayley graph. We study the eigenvalues of the unitary Cayley graph of a finite commutative ring and some gcd-graphs and compute their energy. Moreover, we apply these results to obtain the energy of the complement of unitary Cayley graphs and of the restricted unitary Cayley graphs on quadratic residues.