You would have to take Golden Gate transit routes 40/42 which runs through Richmond to the San Rafel transit center and transfer buses . Route 40 is an express version of route 42 and operates peak weekday periods only. Then you would have to transfer to a Marin Transit Bus #22 to Corte Madera.
Copy and paste this link below:
Scroll down the page to where it says Serving the East Bay. Click on that to get the schedule.
After viewing, hit the back button to get back to the opening page and scroll down to the section that says See Also. Click on Marin Transit and then click on Route #22 to see the schedule.