A magnitude 4.2 earthquake struck in Mendocino County on Friday evening, according to the U.S. Geological Survey.