All the things that may lead to the above have also been forbidden, such as looking at non-mahram women (women to whom one is not closely related), mixing with them or being alone with them. Dressing improperly and forming friendships with the opposite sex have also been forbidden.
All of this is aimed at preventing the provocation of desires, and at directing desires into legitimate channels instead of letting them find forbidden means of expression. One of the principles of Shariah is that whatever leads to haraam deeds is itself haraam, so everything that leads to the provocation of haraam desires is haraam, because it may lead to a person falling into fornication and adultery.
Once desire has been provoked, it invariably means that a person has to find a way of satisfying it, and so he or she commits a haraam act. Reading stories and magazines with sexual content, and looking at dirty pictures and movies provokes these kinds of desires and leads to haraam deeds, so they are not allowed.
We should avoid them and keep away from them. If you have friends who are doing this then warn them and tell them to repent by keeping away from these things and getting rid of any bad books, movies etc. that they still has.
They should feel remorse for the past, and should do more righteous deeds from now on. We ask Allah to grant us all chastity and good health, to purify our hearts and to accept our repentance, for He is the Acceptor of repentance, the Most-Merciful.