Before planning your trip to Nogales—or any other Mexican-American border town—check www.state.gov/travel for updates on drug violence and security precautions.
Don't linger in Nogales, which has experienced some gang-related violence. If you must spend time here, stick to the touristed areas, and watch out for pickpockets and petty thieves. Remaining alert (and sober) will lessen your risk of becoming a victim.
Travel elsewhere in Sonora is generally not problematic. Though you really should plan to drive by day, know that roads here are good and help is easy to find in the populated areas.