We construct a geometric realization of the Khovanov-Lauda-Rouquier algebra
$R$ associated with a symmetric Borcherds-Cartan matrix $A=(a_{ij})_{i,j\in I}$
via quiver varieties. As an application, if $a_{ii} \ne 0$ for any $i\in I$, we
prove that there exists a 1-1 correspondence between Kashiwara's lower global
basis (or Lusztig's canonical basis) of $U_\A^-(\g)$ (resp.\ $V_\A(\lambda)$)
and the set of isomorphism classes of indecomposable projective graded modules
over $R$ (resp.\ $R^\lambda$).