Cowboy movie trapped by archers

I have a vague memory of a western. In one scene cowboys are trapped by Indians, firing arrows down from above. The Indians have marked the cowboys position with spears. The cowboys attempt to break cover and knock down the spears.