A Libby man is accused of attacking a person with pepper spray last month after allegedly harassing a transgender cashier at a local business.