This work proposes novel network analysis techniques for time series. We define the network of a multivariate time series as a graph where nodes denote the components of the process and edges denote non–zero long run partial correlation between two components. Based on the var approximation of the process and its spectral density, we can factorize the network into a directed graph capturing its Granger causality structure and a undirected graph capturing contemporaneous dependencies. Our definition of network is therefore a comprehensive measure of cross-sectional conditional dependence for time series capturing contemporaneous as well as lead/lag relations. We then introduce an algorithm called NETS based on a two step LASSO regression which allows to estimate the two components of the network. The large sample properties of the estimator are analysed and we establish conditions for consistent estimation. The methodology is illustrated with an application to a panel of U.S. bluechips. The risk of monthly equity returns is decomposed in a systematic and an idiosyncratic components and nets is used to analyse the network structure of the idiosyncratic part. The empirical analysis shows that the idiosyncratic risk network captures a significant portion of the total risk and that it exhibits several of the empirical regularities found in social networks.