Molecular clouds as ensembles of transient cores