Real-life spiders, while able to do some remarkable things with silk, are generally somewhat limited in their ability to use it as a ranged weapon. This is not so for their fictional counterparts, who are often shown as able to shoot and launch their silk, both as individual strands and as fully formed webs, to entangle and ensnare their targets. This can be done for a number of reasons, such as dynamism — a spider patiently sitting in its web waiting for prey to pass by doesn't really make for exciting action scenes — or simple lack of research.
It's worth noting that some spiders do possess the ability to cast their webs to ensnare prey. They cannot squirt webbing directly at targets, however (they spin a kind of "net", and then pick it up and throw it with their forelegs), and the range and dexterity of their throws isn't generally on the level sometimes seen in fiction.