Rats love enclosed spaces where they feel safe from predators. Unfortunately that means they often get into places where they don't belong and can do a great deal of damage. Trapping and exclusion (rat-proofing) is the best solution for keeping the rats out.
Mr. Pack Rat technicians often get asked if those flashing light devices being sold on-line and at many hardware stores have any effect on pack rats.