Expanding on Lucas Jardim's solution, the most voted solution doesn't work when using babel package as this package overwrites any \refname or \bibname configurations.
In order to get it working you just have to change it after importing babel package:
\usepackage[$LANGUAGE]{babel}
\addto\captions$LANGUAGE{\renewcommand{\refname}{$NEWREFNAME}}
% \extras$LANGUAGE \bibname
where:
$LANGUAGE is the language you want to use it for
$NEWREFNAME is the new reference name you want to set
The alternatives (extras instead of captions and \bibname instead of \refname) were
written in the comment if the code doesn't work.
Example for Polish language:
Where $LANGUAGE = polish and $NEWREFNAME = Źródła:
\usepackage[polish]{babel}
\addto\captionspolish{\renewcommand{\refname}{Źródła}}