A man is in custody after authorities said he opened fire with a pellet gun near a Cary Barnes & Noble store Friday night.