Man narrowly survives a bear attack