We derive the Green's function for the Black-Scholes partial differential equation with time-varying coefficients and time-dependent boundary conditions. We provide a thorough discussion of its implementation within a pricing algorithm that also accommodates American style options. Greeks can be computed as derivatives of the Green's function. Generic handling of arbitrary time-dependent boundary conditions suggests our approach to be used with the pricing of (American) barrier options, although options without barriers can be priced equally well. Numerical results indicate that knowledge of the structure of the Green's function together with the well-developed tools of numerical integration make our approach fast and numerically stable.