Skyhawk 172/Cutlass 172
Flight Crew Instrument; Flight Crew Private
Flight Crew Last 90 Days 14; Flight Crew Total 668; Flight Crew Type 600
Situational Awareness
Deviation - Altitude Excursion From Assigned Altitude; Deviation / Discrepancy - Procedural FAR; Inflight Event / Encounter VFR In IMC
Flight Crew Became Reoriented; Flight Crew Requested ATC Assistance / Clarification
Human Factors
I was flying south over Marin County at 3500 feet with flight following enroute to SQL.  I requested a transition over SFO (Class B) and was cleared at or below 2000 feet.  A few miles north of SFO airspace I noticed a cloud deck at about 2000 feet a few miles ahead.  I had only a short time before entering Class Bravo and got rushed a bit.  I decided to descend below the clouds to comply with the 2000 foot altitude restriction.  As I got lower; so did the base of the clouds and I entered them at about 1200 feet.  I called SFO and requested vectors.  Denied.  I stopped my descent at 800 feet for safety reasons.  I was still in the clouds and there was traffic in the area. I immediately began a climb to get altitude and broke into the clear in less than a minute well within the 2000 foot altitude restriction.  The rest of the flight was uneventful.  ATC did not request I contact them.  Nonetheless; I did enter clouds while flying VFR. I ascribe this problem to the fact that things happened quickly once ATC cleared me into Class B at or below 2000 feet with a cloud deck below me.  I now realize I should have done one of three things: (1) I could have made a 180 degree turn to the north whence I came because conditions there were CAVU and I would have had time to sort things out; or (2) called ATC and requested an Oakland transition as it appeared clear of clouds to the east; or (3) asked ATC for a SFO transition at my original altitude of 3500 feet where there were no clouds.
While on a VFR flight plan; C-172 pilot encountered IMC while attempting to descend below clouds in aircraft's path. Pilot climbed out of clouds and continued in VMC.