Unit graphs associated with rings