Former State Sen. Richard Pan, a Democrat, has advanced to the November ballot after a hotly contested primary in California’s 6th Congressional District.