Yes, there's a thermocouple or flame sensor that gets carboned up. You should see it glow orange towards the top of the pilot light flame.
Clean it with a brass brush, emory paper or my favorite, jamb some rags around it and blast it with carburetor cleaner.
While some replace these, I have permanently fixed about a dozen of them this way.